<?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 Version20240604211445 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 ref_liasse (id INT AUTO_INCREMENT NOT NULL, code_liasse VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE lnk_liasse_variables (liasse_id INT NOT NULL, variable_id INT NOT NULL, INDEX IDX_72D60161180764BC (liasse_id), INDEX IDX_72D60161F3037E8E (variable_id), PRIMARY KEY(liasse_id, variable_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ref_variable (id INT AUTO_INCREMENT NOT NULL, libelle VARCHAR(255) DEFAULT NULL, model_entity VARCHAR(255) NOT NULL, champ_variable VARCHAR(255) NOT NULL, foreing_key VARCHAR(255) DEFAULT NULL, variable_editique VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE lnk_liasse_variables ADD CONSTRAINT FK_72D60161180764BC FOREIGN KEY (liasse_id) REFERENCES ref_liasse (id)');
$this->addSql('ALTER TABLE lnk_liasse_variables ADD CONSTRAINT FK_72D60161F3037E8E FOREIGN KEY (variable_id) REFERENCES ref_variable (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE lnk_liasse_variables DROP FOREIGN KEY FK_72D60161180764BC');
$this->addSql('ALTER TABLE lnk_liasse_variables DROP FOREIGN KEY FK_72D60161F3037E8E');
$this->addSql('DROP TABLE ref_liasse');
$this->addSql('DROP TABLE lnk_liasse_variables');
$this->addSql('DROP TABLE ref_variable');
}
}