Skip to content

[5.x]: MySQL error 1235 during Craft 4 to 5 upgrade #15853

@TUSAB-web

Description

@TUSAB-web

What happened?

Description

MySQL error 1235 during Craft 4 to 5 upgrade

Steps to reproduce

  1. Craft 5 running in dev, deploying to staging
  2. Deployed, ran composer install
  3. Edited .env file with recommended MySQL settings for the upgrade
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions