SqlSchemaMigrationService getUpdateSuggestions creates invalid MySql statements
Consider an extension changes its database definition from
CREATE TABLE tx_foobar_table ( old_uid int(11) NOT NULL DEFAULT '0', PRIMARY KEY (old_uid) )
The statements the install tool generates for that are:
CREATE TABLE tx_foobar_table ( uid int(11) NOT NULL DEFAULT '0' auto_increment, PRIMARY KEY (uid) )
ALTER TABLE tx_realurl_redirects ADD uid int(11) NOT NULL auto_increment; ALTER TABLE tx_realurl_redirects DROP PRIMARY KEY; ALTER TABLE tx_realurl_redirects ADD PRIMARY KEY (uid);
The problem here is that the column definition includes the
auto_incrementwhere MySQL requires a column with auto_increment to be the Primary Key.
There is already a fix in the source code to circumvent this for newly created primary keys, but not if a primary key is changed.
Updated by Gerrit Code Review about 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/27839
Updated by Markus Klein about 8 years ago
- Status changed from Under Review to Rejected
This is a very very rare case and there hasn't been progress for a year. Therefore closing this one.