For some reason, the doctrine is trying to insert an index called primary instead of actually adding the primary key to my MYSQL database, this is what Doctrine generates:
CREATE UNIQUE INDEX primary ON my_table (columnOne, columnTwo);
This is what my SQL editor generates, and this is the only method that works:
ALTER TABLE my_table ADD PRIMARY KEY (columnOne,columnTwo);
This is my class:
.... class MyTable { /** * @var integer $columnOne * * @Column(name="columnOne", type="integer", nullable=false) * @Id * @GeneratedValue(strategy="NONE") */ private $columnOne; /** * @var integer $columnTwo * * @Column(name="columnTwo", type="integer", nullable=false) * @Id * @GeneratedValue(strategy="NONE") */ private $columnTwo; }
source share