migrations/Version20220623180205.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 Version20220623180205 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  19.         $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');
  20.         $this->addSql('ALTER TABLE std_domains_content ADD CONSTRAINT FK_AF1B9EEA115F0EE5 FOREIGN KEY (domain_id) REFERENCES std_domains (id) ON DELETE CASCADE');
  21.         $this->addSql('ALTER TABLE std_domains_content ADD CONSTRAINT FK_AF1B9EEA451CDAD4 FOREIGN KEY (language_code) REFERENCES std_languages (language_code)');
  22.         $this->addSql('ALTER TABLE std_domains_content ADD CONSTRAINT FK_AF1B9EEA16FE72E1 FOREIGN KEY (updated_by) REFERENCES std_users (id)');
  23.         $this->addSql('ALTER TABLE std_domains_content ADD CONSTRAINT FK_AF1B9EEADE12AB56 FOREIGN KEY (created_by) REFERENCES std_users (id)');
  24.     }
  25.     public function down(Schema $schema) : void
  26.     {
  27.         // this down() migration is auto-generated, please modify it to your needs
  28.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  29.         $this->addSql('DROP TABLE std_domains_content');
  30.     }
  31. }