Solving Failed sql migration when upgrading to 2.11.0+ #2675
juangacovas
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
If you changed VARCHAR(36) columns to UUID data type on MySQL or MariaDB, you'll face a failed migration when executing the query at file:
db/mysql/migrations/05_add_visit_id/migration.sqlwhen doing
yarn build.Solution is executing:
npx prisma migrate resolve --rolled-back "05_add_visit_id"Then change the file
db/mysql/migrations/05_add_visit_id/migration.sql:---- ALTER TABLEwebsite_eventADD COLUMNvisit_idVARCHAR(36) NULL;BIN_TO_UUID(RANDOM_BYTES(16) & 0xffffffffffff0fff3fffffffffffffff | 0x00000000000040008000000000000000) uuidwith this:
UUID() as uuidNow you can execute
yarn buildagain and the migration should be applied with success.Beta Was this translation helpful? Give feedback.
All reactions