migrations/2020/05/Version20200525202652.php line 1
<?phpdeclare(strict_types=1);namespace DoctrineMigrations;use Doctrine\DBAL\Schema\Schema;use Doctrine\Migrations\AbstractMigration;final class Version20200525202652 extends AbstractMigration{public function up(Schema $schema): void{$this->addSql('CREATE TABLE invoice_email (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', created_by_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', invoice_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', sent_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', recipients LONGTEXT NOT NULL, recipients_cc LONGTEXT DEFAULT NULL, recipients_bcc LONGTEXT DEFAULT NULL, message LONGTEXT NOT NULL, INDEX IDX_DA482CC1B03A8386 (created_by_id), INDEX IDX_DA482CC12989F1FD (invoice_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE invoice_email_attachment (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', email_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', filename VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, INDEX IDX_DDC5F2E6A832C1C9 (email_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE invoice_email_draft (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', created_by_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', invoice_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', modified_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', finished_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', recipients LONGTEXT DEFAULT NULL, recipients_cc LONGTEXT DEFAULT NULL, recipients_bcc LONGTEXT DEFAULT NULL, message LONGTEXT DEFAULT NULL, INDEX IDX_CC7FB528B03A8386 (created_by_id), INDEX IDX_CC7FB5282989F1FD (invoice_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('CREATE TABLE invoice_email_draft_attachment (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', email_draft_id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid_binary)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', filename VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, INDEX IDX_4C875950E995DA98 (email_draft_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');$this->addSql('ALTER TABLE invoice_email ADD CONSTRAINT FK_DA482CC1B03A8386 FOREIGN KEY (created_by_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE invoice_email ADD CONSTRAINT FK_DA482CC12989F1FD FOREIGN KEY (invoice_id) REFERENCES invoice (id)');$this->addSql('ALTER TABLE invoice_email_attachment ADD CONSTRAINT FK_DDC5F2E6A832C1C9 FOREIGN KEY (email_id) REFERENCES invoice_email (id)');$this->addSql('ALTER TABLE invoice_email_draft ADD CONSTRAINT FK_CC7FB528B03A8386 FOREIGN KEY (created_by_id) REFERENCES contact (id)');$this->addSql('ALTER TABLE invoice_email_draft ADD CONSTRAINT FK_CC7FB5282989F1FD FOREIGN KEY (invoice_id) REFERENCES invoice (id)');$this->addSql('ALTER TABLE invoice_email_draft_attachment ADD CONSTRAINT FK_4C875950E995DA98 FOREIGN KEY (email_draft_id) REFERENCES invoice_email_draft (id)');}public function down(Schema $schema): void{$this->addSql('ALTER TABLE invoice_email_attachment DROP FOREIGN KEY FK_DDC5F2E6A832C1C9');$this->addSql('ALTER TABLE invoice_email_draft_attachment DROP FOREIGN KEY FK_4C875950E995DA98');$this->addSql('DROP TABLE invoice_email');$this->addSql('DROP TABLE invoice_email_attachment');$this->addSql('DROP TABLE invoice_email_draft');$this->addSql('DROP TABLE invoice_email_draft_attachment');}}