migrations/2020/11/Version20201123230539.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;final class Version20201123230539 extends AbstractMigration{public function up(Schema $schema): void{$this->addSql('CREATE TABLE invoice_draft_email (id BINARY(16) NOT NULL COMMENT \'(DC2Type:invoice_draft_email_id)\', created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid_binary_ordered_time)\', invoice_draft_id BINARY(16) NOT NULL COMMENT \'(DC2Type:invoice_draft_id)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', sent_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', recipients LONGTEXT NOT NULL COMMENT \'(DC2Type:simple_array)\', recipients_cc LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:simple_array)\', recipients_bcc LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:simple_array)\', message LONGTEXT NOT NULL, INDEX IDX_F7AB9A68B03A8386 (created_by_id), INDEX IDX_F7AB9A68FDDB9F89 (invoice_draft_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE invoice_draft_email_attachment (id BINARY(16) NOT NULL COMMENT \'(DC2Type:invoice_draft_email_attachment_id)\', email_id BINARY(16) NOT NULL COMMENT \'(DC2Type:invoice_draft_email_id)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', filename VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, INDEX IDX_B5D547FCA832C1C9 (email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE invoice_draft_email_draft (id BINARY(16) NOT NULL COMMENT \'(DC2Type:invoice_draft_email_draft_id)\', created_by_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary_ordered_time)\', invoice_draft_id BINARY(16) NOT NULL COMMENT \'(DC2Type:invoice_draft_id)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', modified_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', recipients LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:simple_array)\', recipients_cc LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:simple_array)\', recipients_bcc LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:simple_array)\', message LONGTEXT DEFAULT NULL, INDEX IDX_99B433DFB03A8386 (created_by_id), INDEX IDX_99B433DFFDDB9F89 (invoice_draft_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE invoice_draft_email_draft_attachment (id BINARY(16) NOT NULL COMMENT \'(DC2Type:invoice_draft_email_draft_attachment_id)\', email_draft_id BINARY(16) NOT NULL COMMENT \'(DC2Type:invoice_draft_email_draft_id)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', filename VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, INDEX IDX_203032CEE995DA98 (email_draft_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('ALTER TABLE invoice_draft_email ADD CONSTRAINT FK_F7AB9A68B03A8386 FOREIGN KEY (created_by_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE invoice_draft_email ADD CONSTRAINT FK_F7AB9A68FDDB9F89 FOREIGN KEY (invoice_draft_id) REFERENCES invoice_draft (id)');$this->addSql('ALTER TABLE invoice_draft_email_attachment ADD CONSTRAINT FK_B5D547FCA832C1C9 FOREIGN KEY (email_id) REFERENCES invoice_draft_email (id)');$this->addSql('ALTER TABLE invoice_draft_email_draft ADD CONSTRAINT FK_99B433DFB03A8386 FOREIGN KEY (created_by_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE invoice_draft_email_draft ADD CONSTRAINT FK_99B433DFFDDB9F89 FOREIGN KEY (invoice_draft_id) REFERENCES invoice_draft (id)');$this->addSql('ALTER TABLE invoice_draft_email_draft_attachment ADD CONSTRAINT FK_203032CEE995DA98 FOREIGN KEY (email_draft_id) REFERENCES invoice_draft_email_draft (id)');$this->addSql('ALTER TABLE invoice_draft ADD deleted_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid_binary_ordered_time)\', ADD deleted_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\'');$this->addSql('ALTER TABLE invoice_draft ADD CONSTRAINT FK_7BA6C621C76F1F52 FOREIGN KEY (deleted_by_id) REFERENCES contact (id)');$this->addSql('CREATE INDEX IDX_7BA6C621C76F1F52 ON invoice_draft (deleted_by_id)');}public function down(Schema $schema): void{$this->addSql('ALTER TABLE invoice_draft_email_attachment DROP FOREIGN KEY FK_B5D547FCA832C1C9');$this->addSql('ALTER TABLE invoice_draft_email_draft_attachment DROP FOREIGN KEY FK_203032CEE995DA98');$this->addSql('DROP TABLE invoice_draft_email');$this->addSql('DROP TABLE invoice_draft_email_attachment');$this->addSql('DROP TABLE invoice_draft_email_draft');$this->addSql('DROP TABLE invoice_draft_email_draft_attachment');$this->addSql('ALTER TABLE invoice_draft DROP FOREIGN KEY FK_7BA6C621C76F1F52');$this->addSql('DROP INDEX IDX_7BA6C621C76F1F52 ON invoice_draft');$this->addSql('ALTER TABLE invoice_draft DROP deleted_by_id, DROP deleted_at');}}