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
SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key
Full context of command:
ALTER TABLE ReportDetail
DROP PRIMARY KEY,
-- WAS KEY reportingUserNo (reportingUserNo,reportedUserNo),
DROP KEY reportingUserNo,
-- WAS KEY dateReported (dateReported),
DROP KEY dateReported,
ADD COLUMN reportNo INT UNSIGNED NOT NULL auto_increment FIRST,
-- BEFORE reason INT NOT NULL DEFAULT 0,
MODIFY COLUMN reason INT UNSIGNED NOT NULL DEFAULT 0
The text was updated successfully, but these errors were encountered:
What's happening is that we changed the primary key, adding an auto_increment. Modyllic generates a DROP, followed by a change and does an add separately. This separation is (was?) required by other classes of table change limits. (This requirement may have been eliminated by the separation of all foreign key actions.)
As such, there are two ways forward. Either we can defer adding the auto_increment attribute to a later command, or we can see if we can add the primary key as part of this alter command.
The text was updated successfully, but these errors were encountered: