multiSchema: migrate dev fails to apply cleanly to shadow database after custom migration renames table in secondary schema #16794
Labels
bug/2-confirmed
Bug has been reproduced and confirmed.
kind/bug
A reported bug.
team/schema
Issue for team Schema.
topic: multiSchema
multiple schemas
topic: postgresql
topic: prisma migrate reset
CLI: prisma migrate reset
topic: shadow database
Milestone
Bug description
Observed using
4.8.0-dev.41
- this issue becomes visible now #16561 is resolved (thanks for fixing that one!)Update: this issue only occurs when specifying
shadowDatabaseUrl
manually inschema.prisma
- it works as expected when this is removed.The fix to #16561 means
migrate reset
is now successful. However, subsequent attempts to runmigrate dev
immediately aftermigrate reset
(i.e. no schema drift) and a migration history containing a `ALTER TABLE "second.table1" RENAME TO "table2" fails with error:I'm not sure what's going wrong here - via
psql
I can see the table now exists in the shadow databasesecond
under both names table1 and table2 - as if the rename migration is successful but then somehow the original table has been recreated. Perhaps a similarreset
logic bug not resetting secondary schemas correctly during work on the shadow database? But I'm just speculating here (I don't know the full implementation details for howmigrate dev
interacts with the shadow database).How to reproduce
migration.sql:
Expected behavior
No response
Prisma information
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: