Skip to content

[generate:doctrine:entity] id column #21

dbu opened this Issue Jun 27, 2011 · 4 comments

3 participants

dbu commented Jun 27, 2011

in the dialog, i first specified that i want a field id of type integer. the result was


Duplicate definition of column 'id' on entity 'Liip\DemoBundle\Entity\Event' in a field or discriminator column mapping.

and no file was created.

The dialog should tell me i can not create a field named id. (Or better ask first if i want my id column named id or something else.)

It would be nice if it would write some file even if its not valid, with a warning on top. As it is, i lost all my work of specifying fields. (Luckily was just playing around)

stof commented Jun 27, 2011

This should also be reported on the Doctrine issue tracker as adding the field id is done by the EntityGenerator

dbu commented Jun 27, 2011

according to Stof, improving the situation would need to be done in doctrine. for now, the generator could just forbid "id" as field name.

sensiolabs member
fabpot commented Jun 27, 2011

I've added an error message when you try to create a duplicate field:


But as @stof mentioned, you should also report it to the Doctrine tracker as it seems weid to hardcode the id column in the EntityGenerator.

@fabpot fabpot closed this Jun 27, 2011
dbu commented Jun 27, 2011

amazingly fast! thanks!

the link in my comment above points to the doctrine issue i created after stof's comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.