Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Platforms, Schema Managers
-
Security Level: All
-
Labels:None
Description
A table in this application had no primary keys. I created an entity
so i could attempt to use the doctrine:schema:update command to fix it up.
When i attempted to add this:
- @ORM\Id
- @ORM\GeneratedValue(strategy="NONE")
to this:
- @ORM\Column(name="session_id", type="string", length=128,
nullable=false)
it generates SQL like this:
ALTER TABLE whos_online DROP INDEX idx_session_id_zen, ADD UNIQUE INDEX primary (session_id);
ALTER TABLE whos_online CHANGE ip_address ip_address VARCHAR(45) NOT NULL, CHANGE host_address host_address VARCHAR(512) NOT NULL;
and says this:
An exception occurred while executing 'ALTER TABLE whos_online DROP INDEX idx_session_id_zen, ADD UNIQUE INDEX primary (session_id );
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'primary (session_id)' at line 1