We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug report about a changing the primary key order of a composite primary key when generating new migrations.
Each time I create a migration the same SQL statements appear trying to change the order of a composite primary key.
Create an entity with the following mapping:
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping https://www.doctrine-project.org/schemas/orm/doctrine-mapping.xsd"> <entity name="Entities\ModuleText" table="module_texts"> <id name="module" association-key="true" /> <id name="locale" type="string" /> <many-to-one field="module" target-entity="Entities\Module" inversed-by="texts"> <join-column name="module_id" referenced-column-name="id" nullable="false" /> </many-to-one> <field name="name" type="string" nullable="false" /> <field name="description" type="string" nullable="false" /> <field name="instructions" type="text" nullable="false" /> </entity> </doctrine-mapping>
Every time doctrine-migrations migrations:diff is executed the following code is generated:
doctrine-migrations migrations:diff
$this->addSql('DROP INDEX "primary"'); $this->addSql('ALTER TABLE module_texts ADD PRIMARY KEY (locale, module_id)');
Tries to drop the primary key and create a new one switching the field order.
The expected behavior would be not creating this SQL statements.
The text was updated successfully, but these errors were encountered:
Looks like a bug issue in Doctrine has already been opened: doctrine/orm#9171
Sorry, something went wrong.
No branches or pull requests
Bug Report
Summary
Bug report about a changing the primary key order of a composite primary key when generating new migrations.
Current behavior
Each time I create a migration the same SQL statements appear trying to change the order of a composite primary key.
How to reproduce
Create an entity with the following mapping:
Every time
doctrine-migrations migrations:diff
is executed the following code is generated:Tries to drop the primary key and create a new one switching the field order.
Expected behavior
The expected behavior would be not creating this SQL statements.
The text was updated successfully, but these errors were encountered: