migrations/Version20220530112659.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 Version20220530112659 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->addSql('ALTER TABLE attachment_type ADD have_issue_date TINYINT(1) DEFAULT NULL, ADD have_expiration_date TINYINT(1) DEFAULT NULL, ADD have_reference TINYINT(1) DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE invoice_deposit DROP FOREIGN KEY FK_6702ABEA6B253BFF');
  20.         $this->addSql('ALTER TABLE invoice_deposit DROP FOREIGN KEY FK_6702ABEA4C817138');
  21.         $this->addSql('DROP INDEX UNIQ_6702ABEA4C817138 ON invoice_deposit');
  22.         $this->addSql('DROP INDEX UNIQ_6702ABEA6B253BFF ON invoice_deposit');
  23.         $this->addSql('ALTER TABLE invoice_deposit DROP tax_document_id, DROP rib_id');
  24.         $this->addSql('ALTER TABLE provider_request DROP FOREIGN KEY FK_CBCF2D38D37A7B00');
  25.         $this->addSql('ALTER TABLE provider_request DROP FOREIGN KEY FK_CBCF2D384C817138');
  26.         $this->addSql('ALTER TABLE provider_request DROP FOREIGN KEY FK_CBCF2D38B80AEEC1');
  27.         $this->addSql('ALTER TABLE provider_request DROP FOREIGN KEY FK_CBCF2D38D60C56C5');
  28.         $this->addSql('ALTER TABLE provider_request DROP FOREIGN KEY FK_CBCF2D387957E6AE');
  29.         $this->addSql('ALTER TABLE provider_request DROP FOREIGN KEY FK_CBCF2D382418A5C4');
  30.         $this->addSql('DROP INDEX UNIQ_CBCF2D384C817138 ON provider_request');
  31.         $this->addSql('DROP INDEX UNIQ_CBCF2D382418A5C4 ON provider_request');
  32.         $this->addSql('DROP INDEX UNIQ_CBCF2D38D60C56C5 ON provider_request');
  33.         $this->addSql('DROP INDEX UNIQ_CBCF2D38B80AEEC1 ON provider_request');
  34.         $this->addSql('DROP INDEX UNIQ_CBCF2D38D37A7B00 ON provider_request');
  35.         $this->addSql('DROP INDEX UNIQ_CBCF2D387957E6AE ON provider_request');
  36.         $this->addSql('ALTER TABLE provider_request DROP tax_document_id, DROP rccm_document_id, DROP cnss_document_id, DROP rib_document_id, DROP ifu_document_id, DROP arcp_document_id');
  37.     }
  38.     public function down(Schema $schema): void
  39.     {
  40.         // this down() migration is auto-generated, please modify it to your needs
  41.         $this->addSql('ALTER TABLE attachment_type DROP have_issue_date, DROP have_expiration_date, DROP have_reference');
  42.         $this->addSql('ALTER TABLE invoice_deposit ADD tax_document_id INT DEFAULT NULL, ADD rib_id INT DEFAULT NULL');
  43.         $this->addSql('ALTER TABLE invoice_deposit ADD CONSTRAINT FK_6702ABEA6B253BFF FOREIGN KEY (rib_id) REFERENCES attachment (id)');
  44.         $this->addSql('ALTER TABLE invoice_deposit ADD CONSTRAINT FK_6702ABEA4C817138 FOREIGN KEY (tax_document_id) REFERENCES attachment (id)');
  45.         $this->addSql('CREATE UNIQUE INDEX UNIQ_6702ABEA4C817138 ON invoice_deposit (tax_document_id)');
  46.         $this->addSql('CREATE UNIQUE INDEX UNIQ_6702ABEA6B253BFF ON invoice_deposit (rib_id)');
  47.         $this->addSql('ALTER TABLE provider_request ADD tax_document_id INT DEFAULT NULL, ADD rccm_document_id INT DEFAULT NULL, ADD cnss_document_id INT DEFAULT NULL, ADD rib_document_id INT DEFAULT NULL, ADD ifu_document_id INT DEFAULT NULL, ADD arcp_document_id INT DEFAULT NULL');
  48.         $this->addSql('ALTER TABLE provider_request ADD CONSTRAINT FK_CBCF2D38D37A7B00 FOREIGN KEY (rib_document_id) REFERENCES attachment (id)');
  49.         $this->addSql('ALTER TABLE provider_request ADD CONSTRAINT FK_CBCF2D384C817138 FOREIGN KEY (tax_document_id) REFERENCES attachment (id)');
  50.         $this->addSql('ALTER TABLE provider_request ADD CONSTRAINT FK_CBCF2D38B80AEEC1 FOREIGN KEY (rccm_document_id) REFERENCES attachment (id)');
  51.         $this->addSql('ALTER TABLE provider_request ADD CONSTRAINT FK_CBCF2D38D60C56C5 FOREIGN KEY (ifu_document_id) REFERENCES attachment (id)');
  52.         $this->addSql('ALTER TABLE provider_request ADD CONSTRAINT FK_CBCF2D387957E6AE FOREIGN KEY (arcp_document_id) REFERENCES attachment (id)');
  53.         $this->addSql('ALTER TABLE provider_request ADD CONSTRAINT FK_CBCF2D382418A5C4 FOREIGN KEY (cnss_document_id) REFERENCES attachment (id)');
  54.         $this->addSql('CREATE UNIQUE INDEX UNIQ_CBCF2D384C817138 ON provider_request (tax_document_id)');
  55.         $this->addSql('CREATE UNIQUE INDEX UNIQ_CBCF2D382418A5C4 ON provider_request (cnss_document_id)');
  56.         $this->addSql('CREATE UNIQUE INDEX UNIQ_CBCF2D38D60C56C5 ON provider_request (ifu_document_id)');
  57.         $this->addSql('CREATE UNIQUE INDEX UNIQ_CBCF2D38B80AEEC1 ON provider_request (rccm_document_id)');
  58.         $this->addSql('CREATE UNIQUE INDEX UNIQ_CBCF2D38D37A7B00 ON provider_request (rib_document_id)');
  59.         $this->addSql('CREATE UNIQUE INDEX UNIQ_CBCF2D387957E6AE ON provider_request (arcp_document_id)');
  60.     }
  61. }