migrations/Version20200830201526.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20200830201526 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  19.         $this->addSql('ALTER TABLE billing_address DROP FOREIGN KEY FK_46EA8399A455ACCF');
  20.         $this->addSql('DROP INDEX IDX_6660E456A455ACCF ON billing_address');
  21.         $this->addSql('ALTER TABLE billing_address CHANGE idclient customer_id INT DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE billing_address ADD CONSTRAINT FK_6660E4569395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
  23.         $this->addSql('CREATE INDEX IDX_6660E4569395C3F3 ON billing_address (customer_id)');
  24.         $this->addSql('ALTER TABLE street_address DROP FOREIGN KEY FK_52AFD022A455ACCF');
  25.         $this->addSql('DROP INDEX IDX_52AFD022A455ACCF ON street_address');
  26.         $this->addSql('ALTER TABLE street_address CHANGE idclient customer_id INT DEFAULT NULL');
  27.         $this->addSql('ALTER TABLE street_address ADD CONSTRAINT FK_52AFD0229395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
  28.         $this->addSql('CREATE INDEX IDX_52AFD0229395C3F3 ON street_address (customer_id)');
  29.         $this->addSql('ALTER TABLE accounting_entry DROP FOREIGN KEY FK_DB6C942AA455ACCF');
  30.         $this->addSql('DROP INDEX IDX_DB6C942AA455ACCF ON accounting_entry');
  31.         $this->addSql('ALTER TABLE accounting_entry CHANGE idclient customer_id INT DEFAULT NULL');
  32.         $this->addSql('ALTER TABLE accounting_entry ADD CONSTRAINT FK_DB6C942A9395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
  33.         $this->addSql('CREATE INDEX IDX_DB6C942A9395C3F3 ON accounting_entry (customer_id)');
  34.         $this->addSql('ALTER TABLE claim DROP FOREIGN KEY FK_A769DE27A455ACCF');
  35.         $this->addSql('DROP INDEX IDX_A769DE27A455ACCF ON claim');
  36.         $this->addSql('ALTER TABLE claim CHANGE idclient customer_id INT DEFAULT NULL');
  37.         $this->addSql('ALTER TABLE claim ADD CONSTRAINT FK_A769DE279395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
  38.         $this->addSql('CREATE INDEX IDX_A769DE279395C3F3 ON claim (customer_id)');
  39.         $this->addSql('ALTER TABLE trackings DROP FOREIGN KEY FK_FA7EF26A455ACCF');
  40.         $this->addSql('DROP INDEX IDX_FA7EF26A455ACCF ON trackings');
  41.         $this->addSql('ALTER TABLE trackings CHANGE idclient customer_id INT DEFAULT NULL');
  42.         $this->addSql('ALTER TABLE trackings ADD CONSTRAINT FK_FA7EF269395C3F3 FOREIGN KEY (customer_id) REFERENCES clients (id)');
  43.         $this->addSql('CREATE INDEX IDX_FA7EF269395C3F3 ON trackings (customer_id)');
  44.     }
  45.     public function down(Schema $schema) : void
  46.     {
  47.         // this down() migration is auto-generated, please modify it to your needs
  48.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  49.         $this->addSql('ALTER TABLE accounting_entry DROP FOREIGN KEY FK_DB6C942A9395C3F3');
  50.         $this->addSql('DROP INDEX IDX_DB6C942A9395C3F3 ON accounting_entry');
  51.         $this->addSql('ALTER TABLE accounting_entry CHANGE customer_id idClient INT DEFAULT NULL');
  52.         $this->addSql('ALTER TABLE accounting_entry ADD CONSTRAINT FK_DB6C942AA455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
  53.         $this->addSql('CREATE INDEX IDX_DB6C942AA455ACCF ON accounting_entry (idClient)');
  54.         $this->addSql('ALTER TABLE billing_address DROP FOREIGN KEY FK_6660E4569395C3F3');
  55.         $this->addSql('DROP INDEX IDX_6660E4569395C3F3 ON billing_address');
  56.         $this->addSql('ALTER TABLE billing_address CHANGE customer_id idClient INT DEFAULT NULL');
  57.         $this->addSql('ALTER TABLE billing_address ADD CONSTRAINT FK_46EA8399A455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
  58.         $this->addSql('CREATE INDEX IDX_6660E456A455ACCF ON billing_address (idClient)');
  59.         $this->addSql('ALTER TABLE claim DROP FOREIGN KEY FK_A769DE279395C3F3');
  60.         $this->addSql('DROP INDEX IDX_A769DE279395C3F3 ON claim');
  61.         $this->addSql('ALTER TABLE claim CHANGE customer_id idClient INT DEFAULT NULL');
  62.         $this->addSql('ALTER TABLE claim ADD CONSTRAINT FK_A769DE27A455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
  63.         $this->addSql('CREATE INDEX IDX_A769DE27A455ACCF ON claim (idClient)');
  64.         $this->addSql('ALTER TABLE street_address DROP FOREIGN KEY FK_52AFD0229395C3F3');
  65.         $this->addSql('DROP INDEX IDX_52AFD0229395C3F3 ON street_address');
  66.         $this->addSql('ALTER TABLE street_address CHANGE customer_id idClient INT DEFAULT NULL');
  67.         $this->addSql('ALTER TABLE street_address ADD CONSTRAINT FK_52AFD022A455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
  68.         $this->addSql('CREATE INDEX IDX_52AFD022A455ACCF ON street_address (idClient)');
  69.         $this->addSql('ALTER TABLE trackings DROP FOREIGN KEY FK_FA7EF269395C3F3');
  70.         $this->addSql('DROP INDEX IDX_FA7EF269395C3F3 ON trackings');
  71.         $this->addSql('ALTER TABLE trackings CHANGE customer_id idClient INT DEFAULT NULL');
  72.         $this->addSql('ALTER TABLE trackings ADD CONSTRAINT FK_FA7EF26A455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
  73.         $this->addSql('CREATE INDEX IDX_FA7EF26A455ACCF ON trackings (idClient)');
  74.     }
  75. }