<?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 Version20211203130335 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->addSql('ALTER TABLE blog_category DROP FOREIGN KEY FK_72113DE6A545015');
$this->addSql('ALTER TABLE blog_page DROP FOREIGN KEY FK_F4DA3AB0A545015');
$this->addSql('CREATE TABLE blog_page_block (id INT AUTO_INCREMENT NOT NULL, id_page_id INT NOT NULL, titre VARCHAR(255) DEFAULT NULL, content LONGTEXT DEFAULT NULL, route_liee VARCHAR(255) DEFAULT NULL, image_fond VARCHAR(255) DEFAULT NULL, ordre INT NOT NULL, INDEX IDX_35C4A1DD2DBCA94 (id_page_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE blog_page_block ADD CONSTRAINT FK_35C4A1DD2DBCA94 FOREIGN KEY (id_page_id) REFERENCES blog_page (id)');
$this->addSql('DROP TABLE blog_category');
$this->addSql('DROP TABLE web_module');
$this->addSql('DROP TABLE web_module_element');
$this->addSql('DROP TABLE web_page');
$this->addSql('DROP INDEX IDX_F4DA3AB0A545015 ON blog_page');
$this->addSql('ALTER TABLE blog_page DROP id_category_id, CHANGE slug slug VARCHAR(255) NOT NULL, CHANGE content chapeau LONGTEXT NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE blog_category (id INT AUTO_INCREMENT NOT NULL, id_category_id INT DEFAULT NULL, title VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, INDEX IDX_72113DE6A545015 (id_category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE web_module (id INT AUTO_INCREMENT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, titre VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, chapeau VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, lien VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, background VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE web_module_element (id INT AUTO_INCREMENT NOT NULL, img_header VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, titre VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, chapeau VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, lien VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, intitule_lien VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE web_page (id INT AUTO_INCREMENT NOT NULL, route VARCHAR(255) CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE blog_category ADD CONSTRAINT FK_72113DE6A545015 FOREIGN KEY (id_category_id) REFERENCES blog_category (id)');
$this->addSql('DROP TABLE blog_page_block');
$this->addSql('ALTER TABLE blog_page ADD id_category_id INT DEFAULT NULL, CHANGE slug slug VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`, CHANGE chapeau content LONGTEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`');
$this->addSql('ALTER TABLE blog_page ADD CONSTRAINT FK_F4DA3AB0A545015 FOREIGN KEY (id_category_id) REFERENCES blog_category (id)');
$this->addSql('CREATE INDEX IDX_F4DA3AB0A545015 ON blog_page (id_category_id)');
}
}