vendor/bluue/recurring-invoices-bundle/migrations/Version20231123225208.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace RecurringInvoicesBundleMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20231123225208 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice ADD invoice_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD delivery_contact_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\'');
  11.         $this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice ADD CONSTRAINT FK_6B9712E1E7D55D4 FOREIGN KEY (invoice_contact_id) REFERENCES customers_bundle__customer (id)');
  12.         $this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice ADD CONSTRAINT FK_6B9712EF9E4B26E FOREIGN KEY (delivery_contact_id) REFERENCES customers_bundle__customer (id)');
  13.         $this->addSql('CREATE INDEX IDX_6B9712E1E7D55D4 ON recurring_invoices_bundle__recurring_invoice (invoice_contact_id)');
  14.         $this->addSql('CREATE INDEX IDX_6B9712EF9E4B26E ON recurring_invoices_bundle__recurring_invoice (delivery_contact_id)');
  15.     }
  16.     public function down(Schema $schema): void
  17.     {
  18.         $this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice DROP FOREIGN KEY FK_6B9712E1E7D55D4');
  19.         $this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice DROP FOREIGN KEY FK_6B9712EF9E4B26E');
  20.         $this->addSql('DROP INDEX IDX_6B9712E1E7D55D4 ON recurring_invoices_bundle__recurring_invoice');
  21.         $this->addSql('DROP INDEX IDX_6B9712EF9E4B26E ON recurring_invoices_bundle__recurring_invoice');
  22.         $this->addSql('ALTER TABLE recurring_invoices_bundle__recurring_invoice DROP invoice_contact_id, DROP delivery_contact_id');
  23.     }
  24. }