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: Open
    • 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

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Hanov Ruslan
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: