You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Was just going to write the same thing about the resultant user_id column not being reserved. I usually just name user something else to get by (really love the rest of make: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.
This PR was squashed before being merged into the 1.0-dev branch (closes#545).
Discussion
----------
Make User: availability to chose table's name
Hello,
this fixes#485
i may provide a fix for #473 in another PR
Commits
-------
4b42eca check table name using naming strategy
966c355 MakeUser: availability to chose table's name
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 auser
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 auser_id
column - and the addition of theid
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 agroup_name
column.The text was updated successfully, but these errors were encountered: