[DBAL-505] Issue whenusing serial columns in PostgreSQL Created: 24/Apr/13  Updated: 22/Dec/13  Resolved: 22/Dec/13

Status: Resolved
Project: Doctrine DBAL
Component/s: Drivers, Platforms, Schema Managers
Affects Version/s: 2.3.3
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: jos de witte Assignee: Benjamin Eberlei
Resolution: Cannot Reproduce Votes: 0
Labels: None
Environment:

PostgreSQL



 Description   

When using Doctrine ORM mapping fields like this:

/**

  • @var integer
    *
  • @ORM\Column(name="id", type="integer", nullable=false)
  • @ORM\Id
  • @ORM\GeneratedValue(strategy="IDENTITY")
  • @ORM\SequenceGenerator(sequenceName="schemaname.tablename_id_seq", allocationSize=1, initialValue=1)
    */
    private $id;

It first creates the migration perfectly as a serial column with the correct schema.

However when making a new migration diff it generates DROP statements for every sequence for these id, so we have to remove them manually every time.



 Comments   
Comment by Steve Müller [ 19/Dec/13 ]

I think this has been fixed in this commit: https://github.com/Alan01252/dbal/commit/79e894b4493937c0a6eae2e1c8206b188ac2eb7c
Can you please check if the issue still exists on the current master branch? Thank you.

Comment by Benjamin Eberlei [ 22/Dec/13 ]

Tried to reproduce even with the schema name, this seems fixed by the commit Steve Müller showed. However this might exist because of the SequenceGenerator line. Can you remove that one? you don't need it with "IDENTITY".

Closing, please reopen when problem persists.

Generated at Tue Oct 21 07:27:59 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.