mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Missing auto_increment if custom repository annotation presented #5333
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 @olegsv on GitHub (Nov 24, 2016).
Originally assigned to: @ostrolucky on GitHub.
An entity class contains repository annotation, and two fields with GeneratedValue annotations, one defined as "AUTO" and another one as "GUID" .
A table corresponding to the entity is present in DB.
Running
doctrine:schema:updatein Symfony 2.8 / Doctrine 2.4.8 produces incorrect SQL in the following cases:ALTER TABLE my_entity CHANGE id id BIGINT UNSIGNED NOT NULL;ALTER TABLE my_entity CHANGE id id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL;@Ocramius commented on GitHub (Nov 25, 2016):
The ORM only supports single-column generated values. We probably need to throw an exception in the mapping load process.
@olegsv commented on GitHub (Nov 25, 2016):
In case 2 the mapper incorrectly produces similar SQL, there should be no SQL generated.
@voronkovich commented on GitHub (Nov 30, 2016):
@olegsv, your example is not correct. You missed an
@Idannotation in theidentproperty. The@GeneratedValuedoesn't work without the@Id. See http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/annotations-reference.html#generatedvalue@olegsv commented on GitHub (Nov 30, 2016):
@voronkovich see p.2 for bug that occurs without second generated value
@ostrolucky commented on GitHub (Aug 6, 2018):
I gave this a go and I can't reproduce. Also, support for DB-generated UUIDs has been dropped in Doctrine/DBAL 3.0. See https://github.com/doctrine/doctrine2/pull/7330 or https://github.com/doctrine/dbal/pull/3211. Since it's very likely this issue is no longer relevant, I'm going to close this issue. If I am wrong and it's still relevant, please don't hesitate to comment here with reproducer based on master branch and we will reopen.