<?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 Version20240424124950 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('ALTER TABLE piece_jointe ADD programme_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE piece_jointe ADD CONSTRAINT FK_AB5111D462BB7AEE FOREIGN KEY (programme_id) REFERENCES programme (id)');
$this->addSql('CREATE INDEX IDX_AB5111D462BB7AEE ON piece_jointe (programme_id)');
$this->addSql('ALTER TABLE programme ADD note_globale LONGTEXT DEFAULT NULL');
$this->addSql('CREATE TABLE documents (id INT AUTO_INCREMENT NOT NULL, programme_id INT DEFAULT NULL, filename LONGTEXT DEFAULT NULL, description_courte VARCHAR(128) NOT NULL, INDEX IDX_A2B0728862BB7AEE (programme_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE documents ADD CONSTRAINT FK_A2B0728862BB7AEE FOREIGN KEY (programme_id) REFERENCES programme (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE piece_jointe DROP FOREIGN KEY FK_AB5111D462BB7AEE');
$this->addSql('DROP INDEX IDX_AB5111D462BB7AEE ON piece_jointe');
$this->addSql('ALTER TABLE piece_jointe DROP programme_id');
$this->addSql('ALTER TABLE programme DROP note_globale');
$this->addSql('ALTER TABLE documents DROP FOREIGN KEY FK_A2B0728862BB7AEE');
$this->addSql('DROP TABLE documents');
}
}