Skip to content
This repository

[generate:doctrine:entity] id column #21

Closed
dbu opened this Issue June 26, 2011 · 4 comments

3 participants

David Buchmann Fabien Potencier Christophe Coevoet
David Buchmann
dbu commented June 26, 2011

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

[Doctrine\ORM\Mapping\MappingException]

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)

Christophe Coevoet
stof commented June 26, 2011

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

David Buchmann
dbu commented June 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.
http://www.doctrine-project.org/jira/browse/DDC-1229

Fabien Potencier
Owner
fabpot commented June 27, 2011

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

a1e8ab0

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.

Fabien Potencier fabpot closed this June 27, 2011
David Buchmann
dbu commented June 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.