You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MySQL migrations: Multiple primary key defined when sql_generate_invisible_primary_key=ON #48503
Azure Database for MySQL has the 'sql_generate_invisible_primary_key' option set to ON by default.
This issue affects all MySQL >= 8.0.30 where sql_generate_invisible_primary_key is set to ON.
When migrating table with non-standard PK (standard in my case is unsigned numeric with auto_increment), unsigned bigint autoincrement invisible column named my_row_id is automatically generated and migration crashes when trying to create second primary key on column specified in migration itself.
and then it tries to set 'id' as PK which causes Syntax error or access violation: 1068 Multiple primary key defined SQL: alter table cart_storage add primary key (id))
It worked as expected, so after little bit of investigation i found that problem must be inside Blueprint::toSql() and MysqlGrammar::compilePrimary(), in case of enabled sql_generate_invisible_primary_key there must be different method to compile primary key than ALTER one.
Activity