<?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 Version20231222144358 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 (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, notification_template_id INT NOT NULL, channel LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', filter LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', datetime DATETIME DEFAULT NULL, INDEX IDX_BF5476CA9395C3F3 (customer_id), INDEX IDX_BF5476CAD0413CF9 (notification_template_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE notification_template (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, name VARCHAR(255) NOT NULL, channel VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, custom_css LONGTEXT DEFAULT NULL, icon VARCHAR(255) DEFAULT NULL, INDEX IDX_C27027269395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE notification_template_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, body_email LONGTEXT DEFAULT NULL, body_notification LONGTEXT DEFAULT NULL, locale VARCHAR(5) NOT NULL, INDEX IDX_D207BD8B2C2AC5D3 (translatable_id), UNIQUE INDEX notification_template_translation_unique_translation (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE notification_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, body_email LONGTEXT DEFAULT NULL, body_notification LONGTEXT DEFAULT NULL, locale VARCHAR(5) NOT NULL, INDEX IDX_61F2762E2C2AC5D3 (translatable_id), UNIQUE INDEX notification_translation_unique_translation (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CA9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE notification ADD CONSTRAINT FK_BF5476CAD0413CF9 FOREIGN KEY (notification_template_id) REFERENCES notification_template (id)');
$this->addSql('ALTER TABLE notification_template ADD CONSTRAINT FK_C27027269395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE notification_template_translation ADD CONSTRAINT FK_D207BD8B2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES notification_template (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE notification_translation ADD CONSTRAINT FK_61F2762E2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES notification (id) ON DELETE CASCADE');
// $this->addSql('DROP TABLE al_wp_posts_old');
// $this->addSql('DROP INDEX post_content ON al_wp_posts');
// $this->addSql('DROP INDEX post_title ON al_wp_posts');
// $this->addSql('DROP INDEX type_status_date ON al_wp_posts');
// $this->addSql('DROP INDEX post_parent ON al_wp_posts');
// $this->addSql('ALTER TABLE al_wp_posts CHANGE ID id INT AUTO_INCREMENT NOT NULL, CHANGE post_date post_date DATETIME NOT NULL, CHANGE post_status post_status LONGTEXT NOT NULL, CHANGE post_parent post_parent INT NOT NULL, CHANGE menu_order menu_order INT NOT NULL, CHANGE post_type post_type LONGTEXT NOT NULL');
// $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_ed8c63d37987212d TO IDX_439C0067987212D');
// $this->addSql('ALTER TABLE app_translations RENAME INDEX idx_ed8c63d312469de2 TO IDX_439C00612469DE2');
// $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX idx_3f806f872c2ac5d3 TO IDX_6D4A86FF2C2AC5D3');
// $this->addSql('ALTER TABLE app_translations_translation RENAME INDEX app_translation_translation_unique_translation TO app_translations_translation_unique_translation');
// $this->addSql('DROP INDEX titles_only ON country_translation');
// $this->addSql('ALTER TABLE customer RENAME INDEX fk_81398e09f92f3e70 TO IDX_81398E09F92F3E70');
// $this->addSql('DROP INDEX name ON disease_translation');
// $this->addSql('DROP INDEX titles_only ON disease_translation');
// $this->addSql('DROP INDEX name ON drug_translation');
// $this->addSql('DROP INDEX titles_only ON drug_translation');
// $this->addSql('DROP INDEX titles_only ON map_marker_translation');
// $this->addSql('DROP INDEX name ON map_marker_translation');
// $this->addSql('DROP INDEX name ON medical_procedure_translation');
// $this->addSql('DROP INDEX titles_only ON medical_procedure_translation');
// $this->addSql('DROP INDEX name ON page_translation');
// $this->addSql('DROP INDEX titles_only ON page_translation');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE notification_translation DROP FOREIGN KEY FK_61F2762E2C2AC5D3');
$this->addSql('ALTER TABLE notification DROP FOREIGN KEY FK_BF5476CAD0413CF9');
$this->addSql('ALTER TABLE notification_template_translation DROP FOREIGN KEY FK_D207BD8B2C2AC5D3');
$this->addSql('CREATE TABLE al_wp_posts_old (id INT AUTO_INCREMENT NOT NULL, post_date DATETIME NOT NULL, post_content LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, post_title TEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, post_excerpt TEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, post_status LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, post_parent INT NOT NULL, menu_order INT NOT NULL, post_type LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_general_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('DROP TABLE notification');
$this->addSql('DROP TABLE notification_template');
$this->addSql('DROP TABLE notification_template_translation');
$this->addSql('DROP TABLE notification_translation');
$this->addSql('ALTER TABLE al_wp_posts CHANGE id ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, CHANGE post_date post_date DATETIME DEFAULT \'0000-00-00 00:00:00\' NOT NULL, CHANGE post_status post_status VARCHAR(20) CHARACTER SET utf8 DEFAULT \'publish\' NOT NULL COLLATE `utf8_general_ci`, CHANGE post_parent post_parent BIGINT UNSIGNED DEFAULT 0 NOT NULL, CHANGE menu_order menu_order INT DEFAULT 0 NOT NULL, CHANGE post_type post_type VARCHAR(20) CHARACTER SET utf8 DEFAULT \'post\' NOT NULL COLLATE `utf8_general_ci`');
$this->addSql('CREATE FULLTEXT INDEX post_content ON al_wp_posts (post_content)');
$this->addSql('CREATE FULLTEXT INDEX post_title ON al_wp_posts (post_title)');
$this->addSql('CREATE INDEX type_status_date ON al_wp_posts (post_type, post_status, post_date, ID)');
$this->addSql('CREATE INDEX post_parent ON al_wp_posts (post_parent)');
$this->addSql('ALTER TABLE app_translations RENAME INDEX idx_439c00612469de2 TO IDX_ED8C63D312469DE2');
$this->addSql('ALTER TABLE app_translations RENAME INDEX idx_439c0067987212d TO IDX_ED8C63D37987212D');
$this->addSql('ALTER TABLE app_translations_translation RENAME INDEX app_translations_translation_unique_translation TO app_translation_translation_unique_translation');
$this->addSql('ALTER TABLE app_translations_translation RENAME INDEX idx_6d4a86ff2c2ac5d3 TO IDX_3F806F872C2AC5D3');
$this->addSql('CREATE FULLTEXT INDEX titles_only ON country_translation (name)');
$this->addSql('ALTER TABLE customer RENAME INDEX idx_81398e09f92f3e70 TO FK_81398E09F92F3E70');
$this->addSql('CREATE FULLTEXT INDEX name ON disease_translation (name, description)');
$this->addSql('CREATE FULLTEXT INDEX titles_only ON disease_translation (name)');
$this->addSql('CREATE FULLTEXT INDEX name ON drug_translation (name, description)');
$this->addSql('CREATE FULLTEXT INDEX titles_only ON drug_translation (name)');
$this->addSql('CREATE FULLTEXT INDEX titles_only ON map_marker_translation (name)');
$this->addSql('CREATE FULLTEXT INDEX name ON map_marker_translation (name, description)');
$this->addSql('CREATE FULLTEXT INDEX name ON medical_procedure_translation (name, description)');
$this->addSql('CREATE FULLTEXT INDEX titles_only ON medical_procedure_translation (name)');
$this->addSql('CREATE FULLTEXT INDEX name ON page_translation (name, excerpt, body)');
$this->addSql('CREATE FULLTEXT INDEX titles_only ON page_translation (name)');
}
}