migrations/Version20190401100556.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 Version20190401100556 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('ALTER TABLE std_config CHANGE machine_name machine_name VARCHAR(50) NOT NULL COMMENT \'Unique code used in the programming to identify the config variable\', CHANGE variable_type variable_type VARCHAR(10) DEFAULT NULL COMMENT \'Type of the variable. It affects the kind of input generated .
  20.         Possible values:\'');
  21.         $this->addSql('ALTER TABLE std_languages CHANGE language_code language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\'');
  22.         $this->addSql('ALTER TABLE std_templates_blocks DROP PRIMARY KEY;');
  23.         $this->addSql('ALTER TABLE std_templates_blocks ADD id INT UNSIGNED AUTO_INCREMENT NOT NULL COMMENT \'Template Block unique identifier\', ADD is_master TINYINT(1) DEFAULT \'0\' NOT NULL COMMENT \'Flag that indicates if the block is master\', ADD content JSON DEFAULT NULL COMMENT \'Content of the block if Master\', CHANGE template_id template_id INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', CHANGE block_id block_id INT UNSIGNED DEFAULT NULL COMMENT \'Unique identifier\', ADD PRIMARY KEY (id)');
  24.         $this->addSql('ALTER TABLE std_templates_blocks RENAME INDEX idx_b8eac42f5da0fb8 TO fk_std_templates_blocks_std_templates');
  25.     }
  26.     public function down(Schema $schema) : void
  27.     {
  28.         // this down() migration is auto-generated, please modify it to your needs
  29.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  30.         $this->addSql('ALTER TABLE std_config CHANGE machine_name machine_name VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci COMMENT \'Unique code used in the programming to identify the config variable\', CHANGE variable_type variable_type VARCHAR(10) DEFAULT NULL COLLATE utf8mb4_unicode_ci COMMENT \'Type of the variable. It affects the kind of input generated .
  31.                 Possible values:\'');
  32.         $this->addSql('ALTER TABLE std_languages CHANGE language_code language_code VARCHAR(2) NOT NULL COLLATE utf8mb4_unicode_ci COMMENT \'ISO 639 Language code\'');
  33.         $this->addSql('ALTER TABLE std_templates_blocks MODIFY id INT UNSIGNED NOT NULL COMMENT \'Template Block unique identifier\'');
  34.         $this->addSql('ALTER TABLE std_templates_blocks DROP PRIMARY KEY');
  35.         $this->addSql('ALTER TABLE std_templates_blocks DROP id, DROP is_master, DROP content, CHANGE template_id template_id INT UNSIGNED NOT NULL COMMENT \'Unique identifier\', CHANGE block_id block_id INT UNSIGNED NOT NULL COMMENT \'Unique identifier\'');
  36.         $this->addSql('ALTER TABLE std_templates_blocks RENAME INDEX fk_std_templates_blocks_std_templates TO IDX_B8EAC42F5DA0FB8');
  37.     }
  38. }