<?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 Version20220304175948 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 notification_queue (id INT AUTO_INCREMENT NOT NULL, smtp_id INT NOT NULL, email_from VARCHAR(255) DEFAULT NULL, email_to LONGTEXT NOT NULL, email_cc LONGTEXT DEFAULT NULL, email_bcc LONGTEXT DEFAULT NULL, subject LONGTEXT NOT NULL, body LONGTEXT NOT NULL, read_receipt TINYINT(1) NOT NULL, try_date DATETIME DEFAULT NULL, send_date DATETIME DEFAULT NULL, error_string LONGTEXT DEFAULT NULL, status VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_B9499A9AAEBF3FD (smtp_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE notification_templates (id INT AUTO_INCREMENT NOT NULL, language_id INT NOT NULL, name VARCHAR(100) NOT NULL, description LONGTEXT DEFAULT NULL, object VARCHAR(25) NOT NULL, subject VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL, is_default TINYINT(1) NOT NULL, status TINYINT(1) NOT NULL, INDEX IDX_C9C13AD182F1BAF4 (language_id), INDEX id_index (id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE notification_queue ADD CONSTRAINT FK_B9499A9AAEBF3FD FOREIGN KEY (smtp_id) REFERENCES smtps (id)');
$this->addSql('ALTER TABLE notification_templates ADD CONSTRAINT FK_C9C13AD182F1BAF4 FOREIGN KEY (language_id) REFERENCES languages (id)');
$this->addSql('DROP TABLE email_queue');
$this->addSql('DROP TABLE email_templates');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE email_queue (id INT AUTO_INCREMENT NOT NULL, smtp_id INT NOT NULL, email_from VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, email_to LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, email_cc LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, email_bcc LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, subject LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, body LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, read_receipt TINYINT(1) NOT NULL, try_date DATETIME DEFAULT NULL, send_date DATETIME DEFAULT NULL, error_string LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, status VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, created_at DATETIME NOT NULL, INDEX IDX_E2B03EECAEBF3FD (smtp_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE email_templates (id INT AUTO_INCREMENT NOT NULL, language_id INT NOT NULL, name VARCHAR(100) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, description LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, subject VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, body LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, is_default TINYINT(1) NOT NULL, status TINYINT(1) NOT NULL, object VARCHAR(25) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX id_index (id), INDEX IDX_6023E2A582F1BAF4 (language_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE email_queue ADD CONSTRAINT FK_E2B03EECAEBF3FD FOREIGN KEY (smtp_id) REFERENCES smtps (id)');
$this->addSql('ALTER TABLE email_templates ADD CONSTRAINT FK_6023E2A582F1BAF4 FOREIGN KEY (language_id) REFERENCES languages (id)');
$this->addSql('DROP TABLE notification_queue');
$this->addSql('DROP TABLE notification_templates');
}
}