Uploaded image for project: 'Doctrine DBAL'
  1. Doctrine DBAL
  2. DBAL-903

php app/console doctrine:migration:diff generates redundant sql queries for postgres

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      php app/console doctrine:migration:diff

      generates redundant sql queries for postgres

      symfony 2.4.2,
      postgres 9.3
      doctrine/orm: ~2.2,>=2.2.3
      doctrine/doctrine-bundle: 1.2.*
      doctrine/migrations: dev-master
      doctrine/doctrine-migrations-bundle: dev-master

          public function up(Schema $schema)
          {
            
              $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql", "Migration can only be executed safely on 'postgresql'.");
              
              $this->addSql("DROP SEQUENCE acl_classes_id_seq1 CASCADE");
              $this->addSql("DROP SEQUENCE acl_security_identities_id_seq1 CASCADE");
              $this->addSql("DROP SEQUENCE acl_object_identities_id_seq1 CASCADE");
              $this->addSql("DROP SEQUENCE acl_entries_id_seq1 CASCADE");
          }
      
          public function down(Schema $schema)
          {
             
              $this->abortIf($this->connection->getDatabasePlatform()->getName() != "postgresql", "Migration can only be executed safely on 'postgresql'.");
              
              $this->addSql("CREATE SEQUENCE acl_classes_id_seq INCREMENT BY 1 MINVALUE 1 START 1");
              $this->addSql("CREATE SEQUENCE acl_security_identities_id_seq INCREMENT BY 1 MINVALUE 1 START 1");
              $this->addSql("CREATE SEQUENCE acl_object_identities_id_seq INCREMENT BY 1 MINVALUE 1 START 1");
              $this->addSql("CREATE SEQUENCE acl_entries_id_seq INCREMENT BY 1 MINVALUE 1 START 1");
              $this->addSql("CREATE SEQUENCE acl_classes_id_seq1 INCREMENT BY 1 MINVALUE 1 START 1");
              $this->addSql("CREATE SEQUENCE acl_security_identities_id_seq1 INCREMENT BY 1 MINVALUE 1 START 1");
              $this->addSql("CREATE SEQUENCE acl_object_identities_id_seq1 INCREMENT BY 1 MINVALUE 1 START 1");
              $this->addSql("CREATE SEQUENCE acl_entries_id_seq1 INCREMENT BY 1 MINVALUE 1 START 1");
          }
      

        Activity

        Hide
        deeky666 Steve Müller added a comment -

        Doctrine ORM 2.2.x is EOL and won't receive any updates anymore. Please consider upgrading to at least 2.3 and reopen if the issue is still there. There have been a LOT of fixes to platforms' SQL generation since 2.2.x.
        Also if you still encounter the issue, please add your mapping information, otherwise it will be hard to rack the issue down.

        Show
        deeky666 Steve Müller added a comment - Doctrine ORM 2.2.x is EOL and won't receive any updates anymore. Please consider upgrading to at least 2.3 and reopen if the issue is still there. There have been a LOT of fixes to platforms' SQL generation since 2.2.x. Also if you still encounter the issue, please add your mapping information, otherwise it will be hard to rack the issue down.
        Hide
        deeky666 Steve Müller added a comment -

        Oh sorry read your ORM version constraint wrong. Reopening. Please can you give the exact DBAL version you are using and mapping information? Thanks.

        Show
        deeky666 Steve Müller added a comment - Oh sorry read your ORM version constraint wrong. Reopening. Please can you give the exact DBAL version you are using and mapping information? Thanks.
        Hide
        charlie_wasp Timur Ramazanov added a comment -

        Vote for this issue.

        postgres: 9.3,
        doctrine/orm: "~2.2,>=2.2.3",
        doctrine/doctrine-bundle: "~1.3",
        doctrine/migrations": "1.0.x-dev",
        doctrine/doctrine-migrations-bundle": "2.1.x-dev"

        Show
        charlie_wasp Timur Ramazanov added a comment - Vote for this issue. postgres: 9.3, doctrine/orm: "~2.2,>=2.2.3", doctrine/doctrine-bundle: "~1.3", doctrine/migrations": "1.0.x-dev", doctrine/doctrine-migrations-bundle": "2.1.x-dev"

          People

          • Assignee:
            deeky666 Steve Müller
            Reporter:
            hanovruslan Hanov Ruslan
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: