<?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 Version20200820102207 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('ALTER TABLE std_config DROP PRIMARY KEY');
$this->addSql('ALTER TABLE std_config CHANGE language_code language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\'');
$this->addSql('ALTER TABLE std_config ADD PRIMARY KEY (machine_name, language_code)');
$this->addSql('ALTER TABLE std_languages CHANGE language_code language_code VARCHAR(2) NOT NULL COMMENT \'ISO 639 Language code\'');
$this->addSql('ALTER TABLE std_pages_content CHANGE scripts_head scripts_head VARCHAR(255) DEFAULT NULL COMMENT \'Scripts to add to the head of the page\', CHANGE scripts_body scripts_body VARCHAR(255) DEFAULT NULL COMMENT \'Scripts to add to the body of the page\', CHANGE scripts_footer scripts_footer VARCHAR(255) DEFAULT NULL COMMENT \'Scripts to add to the footer of the page\'');
}
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('ALTER TABLE std_config DROP PRIMARY KEY');
$this->addSql('ALTER TABLE std_config CHANGE language_code language_code VARCHAR(2) DEFAULT NULL COLLATE utf8mb4_unicode_ci COMMENT \'ISO 639 Language code\'');
$this->addSql('ALTER TABLE std_config ADD PRIMARY KEY (machine_name)');
$this->addSql('ALTER TABLE std_languages CHANGE language_code language_code VARCHAR(2) NOT NULL COLLATE utf8mb4_unicode_ci COMMENT \'ISO 639 Language code\'');
$this->addSql('ALTER TABLE std_pages_content CHANGE scripts_head scripts_head TEXT DEFAULT NULL COLLATE utf8mb4_unicode_ci COMMENT \'Scripts to add to the head of the page\', CHANGE scripts_body scripts_body TEXT DEFAULT NULL COLLATE utf8mb4_unicode_ci COMMENT \'Scripts to add to the body of the page\', CHANGE scripts_footer scripts_footer TEXT DEFAULT NULL COLLATE utf8mb4_unicode_ci COMMENT \'Scripts to add to the footer of the page\'');
}
}