mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Database columns that start with a number create invalid entities #5461
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HTMLGuyLLC on GitHub (Mar 14, 2017).
Originally assigned to: @Ocramius on GitHub.
When using symfony's doctrine command line command to generate entities from an existing database, if a column starts with a number, it creates a property in the entity that starts with that number which is invalid PHP and causes errors. I suggest either a) throwing an error during generation for the user to change the column name or b) converting that number to the word (2 = two).
@szymach commented on GitHub (May 12, 2017):
Entity generator is being removed (check an issue I submitted), so I doubt this will be resolved.
@Ocramius commented on GitHub (May 20, 2017):
There will always be impedance between what DBs support in identifier names, and what the ORM can pick for names.
This is one of those scenarios where you will simply need to manually define an entity, as any decision taken by the ORM may just lead to field naming collisions (replacing spaces with
_, prefixing columns starting with invalid names, etc).Closing as
won't fix. Thanks @szymach for linking #6418