Jira issue originally created by user darkelfe:
When an update of schema tries to drop a primary key with "auto increment" property (example : @ORM\GeneratedValue(strategy="AUTO")), the execution will fail : it say :
An exception occurred while executing 'ALTER TABLE odesadicola DROP PRIMARY KEY':
SQLSTATE: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key
Apparently, this error occurs because Doctrine try to execute a "drop primary key" on a table and the resulting column of old primary key will be "auto increment".
The answer is to remove "auto increment" attribut of primary key column juste before try to drop the primary key itself.
Issue was closed with resolution "Fixed"
Comment created by andig:
I'm still seeing this problem in 2.5.1 on mysql. Any advice?
Comment created by @deeky666:
It has been fixed and the test case here is also passing: https://github.com/doctrine/dbal/blob/master/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php#L121-L145
Please provide more context and information to make the error reproducable. Thanks.
Only a partial fix, see andig@bd07dce
Sorry, I've meant #786
Comment created by @doctrinebot:
A related Github Pull-Request [GH-786] was assigned:
A related Github Pull-Request [GH-786] was merged: