Details
Description
The schema tool calls AbstractPlatform::getCreateIndexSQL() to create new indexes. When the index is primary, this creates a unique key instead.
The schema tool calls AbstractPlatform::getCreateIndexSQL() to create new indexes. When the index is primary, this creates a unique key instead.
While the description here is very sparse, I think it is about the following problem.
When a primary key is to be created for MySQL, the statement generated is
ADD UNIQUE INDEX PRIMARY ON foo (bar)
This fails with MySQL stating primary is an invalid name. Since "ADD INDEX" is mapped to "ALTER TABLE" anyway, I just made that
ALTER TABLE foo ADD PRIMARY KEY (bar)
which works fine. Also
DROP INDEX primary ON foo
doesn't work, unless I quote primary (since it is a reserved word), but there
ALTER TABLE foo DROP PRIMARY KEY
seems better as well.