Description
When you use make:entity
, we validate property names against the reserved keyword list. If a property name is a keyword, we fail validation and don't allow this. On some systems, this (for example) doesn't allow you to create a user
property, which is kind of convenient :).
And... if this is a relation property, it really shouldn't go through this validation, and a user
property would become a user_id
column - and the addition of the id
part will probably mean that this will never be a reserved word.
To fix this, we would need to move the validation until later when we know the "type" of the field. Then, if the field does fail validation, we can ask the user for a different "column" name - e.g. they might have a group
field name, but call it a group_name
column.
Activity
johnpancoast commentedon Dec 29, 2019
Was just going to write the same thing about the resultant
user_id
column not being reserved. I usually just nameuser
something else to get by (really love the rest ofmake:entity
features) and then I rename it after, but would be great to have the check later like you said.Another solution that was mentioned in #485 would be to allow the
name
values for tables and columns to be specified, i.e., the name values for@ORM\Table()
,@ORM\Column()
, and@ORM\JoinColumn()
annotations.bug #545 Make User: availability to chose table's name (nikophil)