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
-
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.sql
when 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 TABLE
website_eventADD COLUMN
visit_idVARCHAR(36) NULL;
BIN_TO_UUID(RANDOM_BYTES(16) & 0xffffffffffff0fff3fffffffffffffff | 0x00000000000040008000000000000000) uuid
with this:
UUID() as uuid
Now you can execute
yarn build
again and the migration should be applied with success.Beta Was this translation helpful? Give feedback.
All reactions