I'm learning to use Supabase w/ Postgres in Supabase with the following schema:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
previewFeatures = ["multiSchema"]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
directUrl = env("DIRECT_URL")
schemas = ["public", "auth"]
}
enum MedicalCategory {
GENERAL
DENTIST
DERMATOLOGIST
GYNECOLOGIST
PEDIATRICIAN
PSYCHIATRIST
SURGEON
UROLOGIST
OTHER
@@schema("public")
}
model patients {
id String @id @db.Uuid
first_name String?
last_name String?
email String?
users users @relation(fields: [id], references: [id], onDelete: Cascade, onUpdate: NoAction)
@@schema("public")
}
When trying to push this, I get the following error:
Error: P3016
The fallback method for database resets failed, meaning Migrate could not clean up the database entirely. Original error:
db error: ERROR: cannot drop table auth.users because other objects depend on it
DETAIL: constraint buckets_owner_fkey on table storage.buckets depends on table auth.users
constraint objects_owner_fkey on table storage.objects depends on table auth.users
HINT: Use DROP ... CASCADE to drop the dependent objects too.
0: sql_schema_connector::best_effort_reset
with namespaces=Some(Namespaces("public", ["auth"]))
at schema-engine/connectors/sql-schema-connector/src/lib.rs:341
1: schema_core::state::Reset
at schema-engine/core/src/state.rs:433
Obviously I can't drop the auth.users
(for fun, I tried pulling the db schema, dropping the users table, rebuild the table using the prisma schema - didn't work), so what's the issue?
TIA!