Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-903

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

    Details

    • Type: Bug Bug
    • Status: Reopened
    • Priority: Minor 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
        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
        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
        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
        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.

          People

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

            Dates

            • Created:
              Updated: