Deleted tables from auth schema now I can't create...
# help-and-questions
i
So I am using Prisma and was trying out
previewFeatures = ["multiSchema"]
. In doing so, when I ran
npx prisma db push
it dropped the tables from the
auth
schema in Supabase. Now when I try to create a user via UI or
supabase.auth.admin.createUser()
I get the following error:
AuthApiError: Database error checking email
. Has anyone ever ran into this before? Or is there a way I can restore the tables? Not looking to recover any data, just want to be able to create users again.
g
It is a known issue. There really is no safe way to regenerate the auth schema by hand. You would somehow have to run all the gotrue migrations files. Just one in gotrue... https://github.com/supabase/gotrue/issues/1061
i
will take a look, thank you for the link!
FYI I was able to bring back functionality to my original database
I created a new DB instance in Supabase, connected to it and made a backup of the
auth
schema. Then restored it to my original database using
psql
now i am able to successfully create users
both api and ui
g
That works if they are in near time to each other. I don't recommend that often though...
i
absolutely not
but it got the job done in my case
luckily I didnt have any real data in there yet
g
You might add to that issue. Just increases the noise level as neither side seems to be doing anything about it.
i
gotcha
n
> In doing so, when I ran npx prisma db push it dropped the tables from the auth schema in Supabase I think that's the problem.. You should maybe consider not using multischema and follow supabase's method of copying user_id info to
public
schema via triggers.
i
@NanoBit that is exactly what I did. I ditched
multiSchema
and restored the
auth
schema tables by creating a new instance in Supabase, taking a backup of the tables in the
auth
schema and restoring to the original Supabase instance. Now I am able to create users as expected via UI and API.
I know this isnt best practice, but since it was generally within a close time frame this option worked for me.
n
yep. the introspection in prisma is destructive