<?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 Version20220511103217 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('CREATE TABLE page (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, projet_id INT NOT NULL, titre VARCHAR(100) NOT NULL, titre_nav VARCHAR(100) DEFAULT NULL, sous_titre VARCHAR(100) DEFAULT NULL, keywords LONGTEXT DEFAULT NULL, ordre BIGINT DEFAULT NULL, actif TINYINT(1) DEFAULT NULL, description LONGTEXT DEFAULT NULL, description_courte LONGTEXT DEFAULT NULL, description_fin LONGTEXT DEFAULT NULL, image VARCHAR(255) DEFAULT NULL, icon VARCHAR(255) DEFAULT NULL, date_creation DATETIME DEFAULT NULL, date_modification DATETIME DEFAULT NULL, INDEX IDX_140AB620727ACA70 (parent_id), INDEX IDX_140AB620C18272 (projet_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620727ACA70 FOREIGN KEY (parent_id) REFERENCES page (id)');
$this->addSql('ALTER TABLE page ADD CONSTRAINT FK_140AB620C18272 FOREIGN KEY (projet_id) REFERENCES projet (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE page DROP FOREIGN KEY FK_140AB620727ACA70');
$this->addSql('DROP TABLE page');
}
}