Import in prisma the schemas on supabase
Answered
Hackberry nipple gall parasitoid posted this in #help-forum
Hackberry nipple gall parasitoidOP
Hi guys, i have the profiles and projects tables in public schema and i want know how can i export them in schema.prisma which i have in my project.
Thanks
Thanks
Answered by Hackberry nipple gall parasitoid
Fix:
- add previewFeatures = ["multiSchema"] to generator client
- add schemas = ["auth", "public"] to database db
- copy npx prisma generate and paste it in cmd
- copy prisma db pull and paste it in cmd
this will generate the schemas in schema.prisma
- add previewFeatures = ["multiSchema"] to generator client
- add schemas = ["auth", "public"] to database db
- copy npx prisma generate and paste it in cmd
- copy prisma db pull and paste it in cmd
this will generate the schemas in schema.prisma
4 Replies
prisma db pull
Hackberry nipple gall parasitoidOP
I have this problem:
Ć Introspecting based on datasource defined in prisma\schema.prisma
Error: P4002
The schema of the introspected database was inconsistent: The schema of the introspected database was inconsistent: Cross schema references are only allowed when the target schema is listed in the schemas property of your datasource.
Ć Introspecting based on datasource defined in prisma\schema.prisma
Error: P4002
The schema of the introspected database was inconsistent: The schema of the introspected database was inconsistent: Cross schema references are only allowed when the target schema is listed in the schemas property of your datasource.
public.profiles
points to auth.users
in constraint profiles_id_fkey
. Please add auth
to your schemas
property and run this command again.Hackberry nipple gall parasitoidOP
Resolved
Hackberry nipple gall parasitoidOP
Fix:
- add previewFeatures = ["multiSchema"] to generator client
- add schemas = ["auth", "public"] to database db
- copy npx prisma generate and paste it in cmd
- copy prisma db pull and paste it in cmd
this will generate the schemas in schema.prisma
- add previewFeatures = ["multiSchema"] to generator client
- add schemas = ["auth", "public"] to database db
- copy npx prisma generate and paste it in cmd
- copy prisma db pull and paste it in cmd
this will generate the schemas in schema.prisma
Answer