mirror of
https://github.com/doctrine/orm.git
synced 2026-04-29 17:33:15 +02:00
Wrong sequence name generator #5255
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 @andreas4all on GitHub (Sep 14, 2016).
Hi,
I created entity like this:
Doctrine use this sequence:
and PostgreSQL generate this:
@lcobucci commented on GitHub (Sep 14, 2016):
Are you sure that "IDENTITY" is the strategy you want?
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/basic-mapping.html#identifier-generation-strategies
@andreas4all commented on GitHub (Sep 14, 2016):
Yes. I want to use
IDENTITY, because I want to useSERIALin PostgreSQL.@lcobucci commented on GitHub (Sep 14, 2016):
If you take a look on
PostgreSqlPlatformyou'll see that it's correct: https://github.com/doctrine/dbal/blob/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php#L196However
wireless_statistics_service_short_term_wireless_statistic_id_secontains exactly 63 chars which is the value thatAbstractPlatform#getMaxIdentifierLength()returns andDBAL\Schema\Tableuses it to trim the identifier names.I don't know exactly where's the problem (and if it's a problem) but it's definitely related to
DBALand not theORM.Can you reopen this on
DBAL(maybe with some test cases)?@lcobucci commented on GitHub (Sep 14, 2016):
BTW 63 is the max identifier length for PostgreSQL too: https://www.postgresql.org/docs/9.1/static/sql-syntax-lexical.html (so it's not a bug)
@andreas4all commented on GitHub (Sep 14, 2016):
yes, thats right. but doctrine strip last character of sequence name to limit. Postgresql generate it from table name and column name, but PG strip characters from table name not column name (or last character from generated sequence name). You can see it there is
_ter_in Postgresql name, not_term_.@lcobucci commented on GitHub (Sep 14, 2016):
Indeed, but it's still related to the
DBALand not theORM, open that bug there to help us to organize things plz https://github.com/doctrine/dbal