mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 15:02:22 +01:00
DDC-2249: Default value sequence #2829
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 @doctrinebot on GitHub (Jan 19, 2013).
Originally assigned to: @guilhermeblanco on GitHub.
Jira issue originally created by user mdev:
I want to have a column on a table that by default it takes the value from a sequence.
I've tried to do something like this:
/****
* @ORM\Column(type="integer", unique="true")
* @ORM\GeneratedValue(strategy="SEQUENCE")
* @ORM\SequenceGenerator(sequenceName="seq_categorias", initialValue=1, allocationSize=100)
*/
protected $id_categoria;
But this doesn't work, it creates de sequence but not the link between the table column and the sequence. Is there any possibility to do something like this? Or any autoincrement default value instead?
Thanks!
@doctrinebot commented on GitHub (Apr 16, 2014):
Comment created by @guilhermeblanco:
We cannot fix this as sequences only work internally in Doctrine for ID fields.
@doctrinebot commented on GitHub (Apr 16, 2014):
Issue was closed with resolution "Can't Fix"