<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20221026145258 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE mail_template (id INT AUTO_INCREMENT NOT NULL, brand_id INT NOT NULL, type VARCHAR(128) NOT NULL, is_active TINYINT(1) NOT NULL, active_from DATETIME DEFAULT NULL, active_to DATETIME DEFAULT NULL, is_deleted TINYINT(1) NOT NULL, INDEX IDX_4AB7DECB44F5D008 (brand_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE mail_template_translation (id INT AUTO_INCREMENT NOT NULL, mail_template_id INT NOT NULL, lang VARCHAR(4) NOT NULL, title VARCHAR(255) DEFAULT NULL, body LONGTEXT DEFAULT NULL, INDEX IDX_B15D51EBB1057265 (mail_template_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE mail_template ADD CONSTRAINT FK_4AB7DECB44F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');
$this->addSql('ALTER TABLE mail_template_translation ADD CONSTRAINT FK_B15D51EBB1057265 FOREIGN KEY (mail_template_id) REFERENCES mail_template (id)');
$this->addSql('ALTER TABLE brand ADD is_wholesale TINYINT(1) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE mail_template_translation DROP FOREIGN KEY FK_B15D51EBB1057265');
$this->addSql('DROP TABLE mail_template');
$this->addSql('DROP TABLE mail_template_translation');
$this->addSql('ALTER TABLE brand DROP is_wholesale');
}
}