<?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 Version20220623180205 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE std_domains_content (id INT AUTO_INCREMENT NOT NULL, domain_id INT NOT NULL, language_code VARCHAR(2) DEFAULT NULL COMMENT \'ISO 639 Language code\', updated_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', created_by INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', description VARCHAR(50) DEFAULT NULL, created_date DATETIME DEFAULT NULL, updated_date DATETIME DEFAULT NULL, INDEX IDX_AF1B9EEA115F0EE5 (domain_id), INDEX FK_std_domains_std_users (created_by), INDEX FK_std_domains_std_languages (language_code), INDEX FK_std_domains_std_users_2 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE std_domains_content ADD CONSTRAINT FK_AF1B9EEA115F0EE5 FOREIGN KEY (domain_id) REFERENCES std_domains (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE std_domains_content ADD CONSTRAINT FK_AF1B9EEA451CDAD4 FOREIGN KEY (language_code) REFERENCES std_languages (language_code)');
$this->addSql('ALTER TABLE std_domains_content ADD CONSTRAINT FK_AF1B9EEA16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
$this->addSql('ALTER TABLE std_domains_content ADD CONSTRAINT FK_AF1B9EEADE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('DROP TABLE std_domains_content');
}
}