<?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 Version20211019161910 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 evaluation (id INT AUTO_INCREMENT NOT NULL, ecue_id INT NOT NULL, annee_academique_id INT NOT NULL, affectation_id INT NOT NULL, nom VARCHAR(100) NOT NULL, pourcentage DOUBLE PRECISION NOT NULL, date_evaluation DATE NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_1323A5756E48B564 (ecue_id), INDEX IDX_1323A575B00F076 (annee_academique_id), INDEX IDX_1323A5756D0ABA22 (affectation_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE evaluation ADD CONSTRAINT FK_1323A5756E48B564 FOREIGN KEY (ecue_id) REFERENCES ecue (id)');
$this->addSql('ALTER TABLE evaluation ADD CONSTRAINT FK_1323A575B00F076 FOREIGN KEY (annee_academique_id) REFERENCES annee_academique (id)');
$this->addSql('ALTER TABLE evaluation ADD CONSTRAINT FK_1323A5756D0ABA22 FOREIGN KEY (affectation_id) REFERENCES affectation_ue_ecue (id)');
$this->addSql('ALTER TABLE etudiant CHANGE sexe sexe VARCHAR(255) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE evaluation');
$this->addSql('ALTER TABLE etudiant CHANGE sexe sexe VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
}
}