<?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 Version20220601110403 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 article (id INT AUTO_INCREMENT NOT NULL, type_id INT DEFAULT NULL, titre VARCHAR(100) NOT NULL, sous_titre VARCHAR(100) DEFAULT NULL, actif TINYINT(1) DEFAULT NULL, description LONGTEXT DEFAULT NULL, keywords LONGTEXT DEFAULT NULL, image VARCHAR(255) DEFAULT NULL, meta_description LONGTEXT DEFAULT NULL, id_import VARCHAR(255) DEFAULT NULL, id_import_liee VARCHAR(255) DEFAULT NULL, ordre BIGINT DEFAULT NULL, INDEX IDX_23A0E66C54C8C93 (type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE article_contenu (id INT AUTO_INCREMENT NOT NULL, article_id INT NOT NULL, titre VARCHAR(100) DEFAULT NULL, paragraphe LONGTEXT DEFAULT NULL, ordre BIGINT DEFAULT NULL, image VARCHAR(255) DEFAULT NULL, position VARCHAR(100) DEFAULT NULL, id_import_liee VARCHAR(255) DEFAULT NULL, date_creation DATETIME DEFAULT NULL, date_modification DATETIME DEFAULT NULL, INDEX IDX_641044887294869C (article_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE article_type (id INT AUTO_INCREMENT NOT NULL, type VARCHAR(100) NOT NULL, ordre BIGINT DEFAULT NULL, nbr_liaison INT DEFAULT NULL, date_creation DATETIME DEFAULT NULL, date_modification DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE article ADD CONSTRAINT FK_23A0E66C54C8C93 FOREIGN KEY (type_id) REFERENCES article_type (id)');
$this->addSql('ALTER TABLE article_contenu ADD CONSTRAINT FK_641044887294869C FOREIGN KEY (article_id) REFERENCES article (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE article_contenu DROP FOREIGN KEY FK_641044887294869C');
$this->addSql('ALTER TABLE article DROP FOREIGN KEY FK_23A0E66C54C8C93');
$this->addSql('DROP TABLE article');
$this->addSql('DROP TABLE article_contenu');
$this->addSql('DROP TABLE article_type');
}
}