migrations/2022/05/Version20220520054211.php line 1

  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. final class Version20220520054211 extends AbstractMigration
  7. {
  8.     public function up(Schema $schema): void
  9.     {
  10.         $this->addSql('CREATE TABLE app_invoice_payment_notification (id BINARY(16) NOT NULL COMMENT \'(DC2Type:invoice_payment_notification_id)\', subscriber_id BINARY(16) NOT NULL COMMENT \'(DC2Type:contact_id)\', supplier_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:contact_id)\', customer_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:contact_id)\', INDEX IDX_B29A83AF7808B1AD (subscriber_id), INDEX IDX_B29A83AF2ADD6D8C (supplier_id), INDEX IDX_B29A83AF9395C3F3 (customer_id), UNIQUE INDEX uq_invoice_payment_notification (subscriber_id, supplier_id, customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  11.         $this->addSql('ALTER TABLE app_invoice_payment_notification ADD CONSTRAINT FK_B29A83AF7808B1AD FOREIGN KEY (subscriber_id) REFERENCES contact (id)');
  12.         $this->addSql('ALTER TABLE app_invoice_payment_notification ADD CONSTRAINT FK_B29A83AF2ADD6D8C FOREIGN KEY (supplier_id) REFERENCES contact (id)');
  13.         $this->addSql('ALTER TABLE app_invoice_payment_notification ADD CONSTRAINT FK_B29A83AF9395C3F3 FOREIGN KEY (customer_id) REFERENCES contact (id)');
  14.     }
  15.     public function down(Schema $schema): void
  16.     {
  17.         $this->addSql('DROP TABLE app_invoice_payment_notification');
  18.     }
  19. }