-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration failed to apply cleanly to shadow database #24175
Comments
No, it is not only a "shadow database check" but actually how Prisma figures out which SQL has to be executed to bring your database into the desired state. You can of course avoid that by not using The real question here is why this is failing on some of your database servers. Any idea what could be configured differently there to cause a migration to fail? Can you maybe enable query logging on the database level, and see what is being executed under the hood - and where it fails with which error? Seems |
Yeah, we can enable some query logging. Since posting we've tried increasing the connect timeout and query timeouts on the db but with no success. Is there a way to turn on query logging on the prisma side that would apply to the |
Unfortunately not for migrations, sorry. |
Bug description
We're running into an issue with
npx prisma migrate dev
where it's failing to apply the first migration in our migration history cleanly to the shadow db and failing with the error codeHowever it is very clearly able to connect to the db because before this error is thrown it created the db
unwrap_v2
and applies all the migrations to the db. I can also go into the DB and see all the tables created. Is there a way in the short term to turn off the shadow db check?See the full stack trace below.
How to reproduce
I'm not actually sure how to reproduce. I can only get this to happen on two of our dev db's. This is verified on a fresh db however, we dropped the database
unwrap_v2
as well as all shadow databases. It happens reproducibly on two of our dbs.Expected behavior
It should just create and apply the migration file
Prisma information
// Add your schema.prisma
// Add your code using Prisma Client
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: