<?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 Version20220119151439 extends AbstractMigration
{
public function getDescription(): string
{
return 'create Ue_Ect table';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE ue_ect (id INT AUTO_INCREMENT NOT NULL, ue_id INT NOT NULL, ecue_id INT NOT NULL, annee_academique_id INT NOT NULL, coef DOUBLE PRECISION NOT NULL, INDEX IDX_7F355E9262E883B1 (ue_id), INDEX IDX_7F355E926E48B564 (ecue_id), INDEX IDX_7F355E92B00F076 (annee_academique_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE ue_ect ADD CONSTRAINT FK_7F355E9262E883B1 FOREIGN KEY (ue_id) REFERENCES ue (id)');
$this->addSql('ALTER TABLE ue_ect ADD CONSTRAINT FK_7F355E926E48B564 FOREIGN KEY (ecue_id) REFERENCES ecue (id)');
$this->addSql('ALTER TABLE ue_ect ADD CONSTRAINT FK_7F355E92B00F076 FOREIGN KEY (annee_academique_id) REFERENCES annee_academique (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE ue_ect');
}
}