In a Prisma migration, I created and updated some functions on a schema that already exists in the target database where migrations are applied. However, this schema is not managed by Prisma and is not part of my Prisma migrations. I was able to apply this migration successfully on the real database. But now I can’t create any new migrations, because Prisma fails when trying to apply the existing migrations to the shadow database:
Error: P3006Migration `xxxx` failed to apply cleanly to the shadow database.Error:ERROR: schema "auth" does not exist 0: schema_core::state::DevDiagnostic at schema-engine/core/src/state.rs:305
Error: P3006Migration `xxxx` failed to apply cleanly to the shadow database.Error:ERROR: schema "auth" does not exist 0: schema_core::state::DevDiagnostic at schema-engine/core/src/state.rs:305
This makes sense, since the auth schema does not exist in the shadow DB.
My question is: how can I handle migrations that depend on external schemas so they don’t fail in the shadow database? Is there a way to: - conditionally skip parts of a migration when running against the shadow DB? - or configure Prisma to ignore these objects? - or is this simply an anti-pattern and I should manage this differently?
Maybe I’m approaching this the wrong way — I’d appreciate any guidance.