New issue
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
DDC-1318: Unexpectet behavior while using ManyToOne as part ofr composite key #1932
Comments
Comment created by @beberlei: This is probably because of the @GeneratedStrategy annotation, can you try to just remove it? For me there is always only one key generated. |
Comment created by pejot: Hi,
On MySQL creates:
With:
Creates:
The annotations:
Create the same effect like the first one:
Sequence of events :
|
Comment created by @beberlei: Formatted code. |
Comment created by @beberlei: Can you drop the table and show the DDL generated by both "orm:schema-tool:create --dump-sql" and "orm:schema-tool:update --dump-sql" ? I checked with our testsuite and all the entities generate the correct primary keys. |
Comment created by @Ocramius: Is this still valid with newer versions of the ORM? |
Comment created by @beberlei: No feedback given |
Issue was closed with resolution "Incomplete" |
Jira issue originally created by user pejot:
Hi!
Ran into a problem while wanted to use a ManyToOne as part of a primary key:
By default doctrine creates a table with 2 single keys (the preference key is the primary key) which is of course incorrect.
Had to add @column(name="user_id",type="integer") to the user column to fix the index problem but that introduced another problem. The entity no longer accepter \Entity\User as a value for user and takes only a smallint as defined.
The text was updated successfully, but these errors were encountered: