[DDC-2608] Wrong SQL generated for @SequenceGenerator, throws Exception Created: 12/Aug/13  Updated: 08/Sep/13  Resolved: 08/Sep/13

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

Type: Bug Priority: Major
Reporter: Dowl Lci Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None
Environment:

Not necessary



 Description   

I'm using Doctrine2 v2.3.4 and PostgreSQL.

I created an entity with this:

/**

  • @Id
  • @Column(type="integer")
  • @GeneratedValue
  • @SequenceGenerator(allocationSize=100)
  • @var integer
    */
    protected $id;

And then run `orm:schema-tool:update --force`. But the sequence name is missing in the SQL and I get this error:

[Doctrine\DBAL\DBALException]
An exception occurred while executing 'CREATE SEQUENCE INCREMENT BY 100 MINVALUE 1 START 1':

SQLSTATE[42601]: Syntax error: 7 ERROR: syntax error at or near "BY"
LINE 1: CREATE SEQUENCE INCREMENT BY 100 MINVALUE 1 START 1
^
Adding sequenceName="tablename_seq" fixes it.


Generated at Tue Oct 21 02:42:30 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.