<?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 Version20220602100537 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_critere (id INT AUTO_INCREMENT NOT NULL, type_id INT NOT NULL, label VARCHAR(255) NOT NULL, date_creation DATETIME DEFAULT NULL, date_modification DATETIME DEFAULT NULL, INDEX IDX_92B8C4E4C54C8C93 (type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE article_critere_valeur (id INT AUTO_INCREMENT NOT NULL, critere_id INT NOT NULL, article_id INT NOT NULL, valeur VARCHAR(255) NOT NULL, date_creation DATETIME DEFAULT NULL, date_modification DATETIME DEFAULT NULL, INDEX IDX_A81F9E8E9E5F45AB (critere_id), INDEX IDX_A81F9E8E7294869C (article_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE article_critere ADD CONSTRAINT FK_92B8C4E4C54C8C93 FOREIGN KEY (type_id) REFERENCES article_type (id)');
$this->addSql('ALTER TABLE article_critere_valeur ADD CONSTRAINT FK_A81F9E8E9E5F45AB FOREIGN KEY (critere_id) REFERENCES article_critere (id)');
$this->addSql('ALTER TABLE article_critere_valeur ADD CONSTRAINT FK_A81F9E8E7294869C 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_critere_valeur DROP FOREIGN KEY FK_A81F9E8E9E5F45AB');
$this->addSql('DROP TABLE article_critere');
$this->addSql('DROP TABLE article_critere_valeur');
}
}