What happened?
Description
MySQL error 1235 during Craft 4 to 5 upgrade
Steps to reproduce
- Craft 5 running in dev, deploying to staging
- Deployed, ran composer install
- Edited .env file with recommended MySQL settings for the upgrade
- Run php craft up
Expected behavior
A successful upgrade
Actual behavior
Most migrations went through normally, but an error was received pretty far into the migration process:
'*** applying m231013_185640_changedfields_amend_primary_key
> drop primary key elementId ...Exception: SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support 'existing primary key drop without adding a new primary key. In @@sql_generate_invisible_primary_key=ON mode table should have a primary key. Please add a new primary key to be able to drop existing primary key.'
The SQL being executed was: ALTER TABLE craft_changedfields DROP PRIMARY KEY (/home/site/vendor/yiisoft/yii2/db/Schema.php:676)’
Full error message here:
craft5-migration-error.txt
Craft CMS version
5.4.6
PHP version
8.2.21
Operating system and version
Azure Linux Web App
Database type and version
MySQL 8.0.37
Image driver and version
n/a
Installed plugins and versions
No response
What happened?
Description
MySQL error 1235 during Craft 4 to 5 upgrade
Steps to reproduce
Expected behavior
A successful upgrade
Actual behavior
Most migrations went through normally, but an error was received pretty far into the migration process:
'*** applying m231013_185640_changedfields_amend_primary_key
> drop primary key elementId ...Exception: SQLSTATE[42000]: Syntax error or access violation: 1235 This version of MySQL doesn't yet support 'existing primary key drop without adding a new primary key. In @@sql_generate_invisible_primary_key=ON mode table should have a primary key. Please add a new primary key to be able to drop existing primary key.'
The SQL being executed was: ALTER TABLE
craft_changedfieldsDROP PRIMARY KEY (/home/site/vendor/yiisoft/yii2/db/Schema.php:676)’Full error message here:
craft5-migration-error.txt
Craft CMS version
5.4.6
PHP version
8.2.21
Operating system and version
Azure Linux Web App
Database type and version
MySQL 8.0.37
Image driver and version
n/a
Installed plugins and versions
No response