Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-505

Issue whenusing serial columns in PostgreSQL

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.3.3
    • Fix Version/s: None
    • Security Level: All
    • 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.

        Activity

        jos de witte created issue -
        Hide
        Steve Müller added a comment -

        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.

        Show
        Steve Müller added a comment - 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.
        Hide
        Benjamin Eberlei added a comment -

        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.

        Show
        Benjamin Eberlei added a comment - 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.
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Cannot Reproduce [ 5 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-505, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            jos de witte
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: