Doctrine Migrations
  1. Doctrine Migrations
  2. DMIG-39

Issue when using serjal columns in PostgreSQL with Doctrine ORM Identity fields

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Environment:
      PostgreSQL and migrations

      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

        Hide
        Marco Pivetta added a comment -

        This is a DBAL problem.

        Please verify this with the DBAL diff tools (latest master) only and eventually report a DBAL issue without involving migrations.

        Show
        Marco Pivetta added a comment - This is a DBAL problem. Please verify this with the DBAL diff tools (latest master) only and eventually report a DBAL issue without involving migrations.

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            jos de witte
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: