[DDC-2249] Default value sequence Created: 19/Jan/13  Updated: 16/Apr/14  Resolved: 16/Apr/14

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Task Priority: Major
Reporter: Maria Assignee: Guilherme Blanco
Resolution: Can't Fix Votes: 1
Labels: None

Symfony 2, linux


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?


Comment by Guilherme Blanco [ 16/Apr/14 ]

We cannot fix this as sequences only work internally in Doctrine for ID fields.

Generated at Tue Oct 13 19:12:06 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.