<?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 Version20190515084850 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_pages_attributes_values (page_id INT UNSIGNED NOT NULL COMMENT \'Page unique identifier\', attribute_value_id INT UNSIGNED NOT NULL COMMENT \'Attribute value unique identifier\', INDEX IDX_A31671E8C4663E4 (page_id), INDEX IDX_A31671E865A22152 (attribute_value_id), PRIMARY KEY(page_id, attribute_value_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
$this->addSql('ALTER TABLE std_pages_attributes_values ADD CONSTRAINT FK_A31671E8C4663E4 FOREIGN KEY (page_id) REFERENCES std_pages (id)');
$this->addSql('ALTER TABLE std_pages_attributes_values ADD CONSTRAINT FK_A31671E865A22152 FOREIGN KEY (attribute_value_id) REFERENCES std_attributes_values (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_pages_attributes_values');
}
}