Fill out the following bug report template with as much detail as possible!
Are you sure this is a bug? If you just need help, post in the developer help category. If it’s a feature request, head to the ideas category.
Issue Summary
- The column type that is inherited when migrating from MariaDB to MySQL8 for table ids is not compatible with foreign key constraints during upgrade.
- Went from v6.0.6 to 6.37.1 and ran into this error. Was able to upgrade to 6.26.0 without issues, 6.27.0 contains the first migration where this shows up.
Steps to Reproduce
- Install a pre-v6.27.0 with MariaDB as the backend
- Follow mysqldump instructions to upgrade to MySQL8
- Use the ghost-cli to upgrade to anything v6.27.0 or higher
Setup information
Ghost Version
Started with 6.0.6, have been able to upgrade to 6.26.0 but any step beyond runs into the issue.
Node.js Version
v22.22.2
How did you install Ghost?
Running on a Raspberry Pi5 connecting to a Linux server running MySQL8. Installed using ghost-cli originally connected to MariaDB running the on the same Pi.
Provide details of your host & operating system
RPi5, Raspberry Pi OS (Debian 12 based)
Database type
MySQL8
Browser & OS version
Include if reporting frontend bugs.
Relevant log / error output
{“name”:“Log”,“hostname”:“raspberrypi”,“pid”:25206,“level”:50,“version”:“6.27.0”,“err”:{“id”:300,“domain”:“https://magicmagswashere.com/",“code”:“ER_FK_INCOMPATIBLE_COLUMNS”,“name”:“MigrationScriptError”,“statusCode”:500,“level”:“critical”,“message”:"alter table gifts add constraint gifts_buyer_member_id_foreign foreign key (buyer_member_id) references members (id) on delete SET NULL - Referencing column ‘buyer_member_id’ and referenced column ‘id’ in foreign key constraint ‘gifts_buyer_member_id_foreign’ are incompatible.”,“context”:“{“config”:{“transaction”:false},“name”:“2026-04-06-07-48-06-add-gifts-table.js”}”,“help”:““Error occurred while executing the following migration: 2026-04-06-07-48-06-add-gifts-table.js””,“stack”:“Error: alter table gifts add constraint gifts_buyer_member_id_foreign foreign key (buyer_member_id) references members (id) on delete SET NULL - Referencing column ‘buyer_member_id’ and referenced column ‘id’ in foreign key constraint ‘gifts_buyer_member_id_foreign’ are incompatible.\n at /home/ghost/versions/6.27.0/node_modules/knex-migrator/lib/index.js:1032:19\n at Packet.asError (/home/ghost/versions/6.27.0/node_modules/mysql2/lib/packets/packet.js:739:17)\n at Query.execute (/home/ghost/versions/6.27.0/node_modules/mysql2/lib/commands/command.js:29:26)\n at Connection.handlePacket (/home/ghost/versions/6.27.0/node_modules/mysql2/lib/base/connection.js:508:34)\n at PacketParser.onPacket (/home/ghost/versions/6.27.0/node_modules/mysql2/lib/base/connection.js:93:12)\n at PacketParser.executeStart (/home/ghost/versions/6.27.0/node_modules/mysql2/lib/packet_parser.js:75:16)\n at Socket. (/home/ghost/versions/6.27.0/node_modules/mysql2/lib/base/connection.js:100:25)\n at Socket.emit (node:events:519:28)\n at addChunk (node:internal/streams/readable:561:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)\n at Readable.push (node:internal/streams/readable:392:5)\n at TCP.onStreamRead (node:internal/stream_base_commons:189:23)”,“hideStack”:false},“msg”:“alter table gifts add constraint gifts_buyer_member_id_foreign foreign key (buyer_member_id) references members (id) on delete SET NULL - Referencing column ‘buyer_member_id’ and referenced column ‘id’ in foreign key constraint ‘gifts_buyer_member_id_foreign’ are incompatible.”,“time”:“2026-05-12T11:12:48.336Z”,“v”:0}Copy and paste any relevant log output. Use backticks to format this into code.