Procedures
-
Sometimes we don't want prisma to notice the changes in migration file as we have done some adjustment manually (and make the corresponding changes in migration file as well so that it automatically migrates to production).
-
Run to the target migration:
shasum -a 256 prisma/migrations/20220510001642_my_migration/migration.sql
-
This will produce something like:
fc27e97b9a61877f7f59d59a69c8c0bd2cd3271bc44b9f208800ed458d18a10b prisma/migrations/20220510001642_my_migration/migration.sql
-
Update the database of target row with
checksum
column with the hash:fc27e97b9a61877f7f59d59a69c8c0bd2cd3271bc44b9f208800ed458d18a10b
-
Then
yarn migrate
should have no warning such as:The migration `20240219084746_constraint_admin_to_invite_people` was modified after it was applied. We need to reset the "public" schema at "ep-aged-morning-26453078.ap-southeast-1.aws.neon.tech" Do you want to continue? All data will be lost.
which is of course NO!