<?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 Version20221026215604 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 brand_sms_gateway (id INT AUTO_INCREMENT NOT NULL, brand_id INT NOT NULL, name VARCHAR(255) NOT NULL, system_type VARCHAR(32) NOT NULL, system_token VARCHAR(255) DEFAULT NULL, sender_name VARCHAR(255) DEFAULT NULL, is_test_mode TINYINT(1) NOT NULL, INDEX IDX_85B5365044F5D008 (brand_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE brand_smtp (id INT AUTO_INCREMENT NOT NULL, brand_id INT NOT NULL, name VARCHAR(255) NOT NULL, from_name VARCHAR(255) DEFAULT NULL, from_email VARCHAR(255) DEFAULT NULL, user VARCHAR(255) NOT NULL, password VARCHAR(255) DEFAULT NULL, host VARCHAR(255) NOT NULL, port INT DEFAULT NULL, reply_to VARCHAR(255) DEFAULT NULL, security_type VARCHAR(32) DEFAULT NULL, INDEX IDX_24F04F6C44F5D008 (brand_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE sms_template (id INT AUTO_INCREMENT NOT NULL, brand_id INT NOT NULL, type VARCHAR(255) NOT NULL, is_active TINYINT(1) DEFAULT NULL, active_from DATETIME DEFAULT NULL, active_to DATETIME DEFAULT NULL, is_deleted TINYINT(1) DEFAULT NULL, INDEX IDX_F1963E8244F5D008 (brand_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE sms_template_translation (id INT AUTO_INCREMENT NOT NULL, sms_template_id INT DEFAULT NULL, lang VARCHAR(4) NOT NULL, body LONGTEXT DEFAULT NULL, INDEX IDX_510C4983DC592723 (sms_template_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE brand_sms_gateway ADD CONSTRAINT FK_85B5365044F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');
$this->addSql('ALTER TABLE brand_smtp ADD CONSTRAINT FK_24F04F6C44F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');
$this->addSql('ALTER TABLE sms_template ADD CONSTRAINT FK_F1963E8244F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');
$this->addSql('ALTER TABLE sms_template_translation ADD CONSTRAINT FK_510C4983DC592723 FOREIGN KEY (sms_template_id) REFERENCES sms_template (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sms_template_translation DROP FOREIGN KEY FK_510C4983DC592723');
$this->addSql('DROP TABLE brand_sms_gateway');
$this->addSql('DROP TABLE brand_smtp');
$this->addSql('DROP TABLE sms_template');
$this->addSql('DROP TABLE sms_template_translation');
}
}