Hey there, at what point is SuperTokens applying t...
# support-questions
s
Hey there, at what point is SuperTokens applying the SQL commands to the database to create tables like
emailpassword_users
, etc... I am asking because i use goent and i successfully can relate to the
emailpassword_users
table. The problem is on the first start if the database does not exist entgo Migrations fail because the table `emailpassword_users`does not exist at that point. My code looks like this
Copy code
go
func DefineRoutes() *gin.Engine {
    supertokens.Init()

    // Adding the SuperTokens middleware in this function as well
    app, v1 := gnshttp.GetGinApp("v1")

    // Fails with: failed creating schema resources: sql/schema: create "user_profiles" table: pq: relation "emailpassword_users" does not exist
    ent.Schema.Create(...)
    ...
}
As you can see I am initializing SuperTokens first, but that does not help
r
Hey! The tables areas created when the supertokens core starts
And the core starting has nothing to do with the supertokens backend sdk’s init function
s
Oh yeah right. So you mean the start of the containers is responsible
r
Yea.
s
The SuperToken Docker Container does it?
r
Yes.
s
Of course 😄 Totally forgot there was a running container
Thanks man 👍
r
Hope this solves the issue
Happy to help 🙂