<?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 Version20220825220557 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 contrainte (id INT AUTO_INCREMENT NOT NULL, niveau_id INT NOT NULL, diplome_id INT NOT NULL, nom VARCHAR(100) NOT NULL, type_contrainte VARCHAR(50) NOT NULL COMMENT \'(DC2Type:typeContrainte)\', valeur DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME DEFAULT NULL, INDEX IDX_17925A70B3E9C81 (niveau_id), INDEX IDX_17925A7026F859E2 (diplome_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE contrainte ADD CONSTRAINT FK_17925A70B3E9C81 FOREIGN KEY (niveau_id) REFERENCES niveau (id)');
$this->addSql('ALTER TABLE contrainte ADD CONSTRAINT FK_17925A7026F859E2 FOREIGN KEY (diplome_id) REFERENCES diplome (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE contrainte');
}
}