Takeo Kusama
06/28/2022, 9:58 AMIrek Prucnal
06/28/2022, 10:03 AMTakeo Kusama
06/28/2022, 10:11 AMTakeo Kusama
06/28/2022, 11:41 AM1. create database for shadow_database
2. remove migration files temporally you want to rollback
3. run `prisma migrate diff --from-schema-datamodel prisma/schema.prisma --to-migrations prisma/migrations --shadow-database-url "${SHADOW_DATABASE_URL}" --script > down.sql`
4. run `prisma db execute --file ./down.sql --schema prisma/schema.prisma`
5. delete records from _prisma_migrations you rolled back
prisma migrate dev detect conflict and intend to reset migration even if migrate records have marked as applied or rollbacked column, so you need delete migration records in development.
If you need to keep migration files for production already applied, restore remove migration files and applied.
prisma resolve (--rolled-back or --applied)