<?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 Version20211005164251 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 ecue (id INT AUTO_INCREMENT NOT NULL, ue_id INT NOT NULL, code VARCHAR(255) NOT NULL, intitule VARCHAR(200) NOT NULL, coef INT NOT NULL, UNIQUE INDEX UNIQ_8BDB53077153098 (code), INDEX IDX_8BDB53062E883B1 (ue_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE ue (id INT AUTO_INCREMENT NOT NULL, code VARCHAR(50) NOT NULL, intitule VARCHAR(100) NOT NULL, moyenne DOUBLE PRECISION NOT NULL, moyenne_el DOUBLE PRECISION NOT NULL, credit INT NOT NULL, UNIQUE INDEX UNIQ_2E490A9B77153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE ecue ADD CONSTRAINT FK_8BDB53062E883B1 FOREIGN KEY (ue_id) REFERENCES ue (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE ecue DROP FOREIGN KEY FK_8BDB53062E883B1');
$this->addSql('DROP TABLE ecue');
$this->addSql('DROP TABLE ue');
}
}