migrations/Version20221026215604.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20221026215604 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $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');
  20.         $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');
  21.         $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');
  22.         $this->addSql('ALTER TABLE brand_sms_gateway ADD CONSTRAINT FK_85B5365044F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');
  23.         $this->addSql('ALTER TABLE brand_smtp ADD CONSTRAINT FK_24F04F6C44F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');
  24.         $this->addSql('ALTER TABLE sms_template ADD CONSTRAINT FK_F1963E8244F5D008 FOREIGN KEY (brand_id) REFERENCES brand (id)');
  25.         $this->addSql('ALTER TABLE sms_template_translation ADD CONSTRAINT FK_510C4983DC592723 FOREIGN KEY (sms_template_id) REFERENCES sms_template (id)');
  26.     }
  27.     public function down(Schema $schema): void
  28.     {
  29.         // this down() migration is auto-generated, please modify it to your needs
  30.         $this->addSql('ALTER TABLE sms_template_translation DROP FOREIGN KEY FK_510C4983DC592723');
  31.         $this->addSql('DROP TABLE brand_sms_gateway');
  32.         $this->addSql('DROP TABLE brand_smtp');
  33.         $this->addSql('DROP TABLE sms_template');
  34.         $this->addSql('DROP TABLE sms_template_translation');
  35.     }
  36. }