Subject: | mysqldiff fails adding an auto_increment field |
mysqldiff fails if a field with auto incrementing should be added. The
generated SQL looks like this:
ALTER TABLE visits ADD COLUMN visit_id int(10) unsigned NOT NULL auto_increment;
ALTER TABLE visits ADD PRIMARY KEY (visit_id);
MySQL fails with the error message:
Incorrect table definition; There can only be one auto column and it must be defined as a key
It would work if both ALTER statements would be put into one:
ALTER TABLE visits ADD COLUMN visit_id int(10) unsigned NOT NULL auto_increment primary key;
Regards,
Slaven