Hi guys,
There seems to be some issue regarding the migrations when trying to upgrade Ghsot from version 3.32.2 to latest one - 3.33.0
[2020-09-15 14:15:23] INFO Ghost boot 4.107s
[2020-09-15 14:15:23] INFO Creating database backup
[2020-09-15 14:15:23] INFO Database backup written to: /var/www/ghost_ro/content/data/lungu-florin.ghost.2020-09-15-12-15-23.json
[2020-09-15 14:15:23] INFO Adding table: email_batches
[2020-09-15 14:15:24] WARN Skipping drop table "email_recipients" - does not exist
[2020-09-15 14:15:24] INFO Dropping table: email_batches
[2020-09-15 14:15:24] ERROR
NAME: MigrationScriptError
CODE: UNKNOWN_CODE_PLEASE_REPORT
MESSAGE: alter table `email_batches` add constraint `email_batches_email_id_foreign` foreign key
(`email_id`) references `emails` (`id`) - UNKNOWN_CODE_PLEASE_REPORT: Referencing column
'email_id' and referenced column 'id' in foreign key constraint 'email_batches_email_id_foreign' are
incompatible.
level: normal
{"name":"01-add-email-recipients-tables.js"}
"Error occurred while executing the following migration: 01-add-email-recipients-tables.js"
MigrationScriptError: alter table `email_batches` add constraint `email_batches_email_id_foreign`
foreign key (`email_id`) references `emails` (`id`) - UNKNOWN_CODE_PLEASE_REPORT: Referencing
column 'email_id' and referenced column 'id' in foreign key constraint 'email_batches_email_id_foreign'
are incompatible. at
MigrationScriptError.KnexMigrateError (/var/www/ghost_ro/versions/3.33.0/node_modules/knex-
migrator/lib/errors.js:7:26)
at new MigrationScriptError (/var/www/ghost_ro/versions/3.33.0/node_modules/knex-
migrator/lib/errors.js:25:26)
at /var/www/ghost_ro/versions/3.33.0/node_modules/knex-migrator/lib/index.js:1055:19
Error: UNKNOWN_CODE_PLEASE_REPORT: Referencing column 'email_id' and referenced column 'id'
in foreign key constraint 'email_batches_email_id_foreign' are incompatible.
at Query.Sequence._packetToError
(/var/www/ghost_ro/versions/3.33.0/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
System informations:
OS: Ubuntu Server 20.04
MySQL: 8.0.21
Ghost: 3.33.0
Ghost install: ghost-cli
It seems that schemas creation fails or is not done correctly.
After now, all upgrades done through ghost-cli gone fine without errors.