<?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 Version20220407143118 extends AbstractMigration
{
public function getDescription(): string
{
return 'ajout d\'un slug pour le livret';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE livret ADD slug VARCHAR(255) NOT NULL');
$this->addSql('DROP INDEX IDX_7D3A72C515761DAB ON livret_acquis');
$this->addSql('ALTER TABLE livret_acquis ADD CONSTRAINT FK_C02E303C15761DAB FOREIGN KEY (competence_id) REFERENCES livret_competence (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE livret DROP slug');
$this->addSql('ALTER TABLE livret_acquis DROP FOREIGN KEY FK_C02E303C15761DAB');
$this->addSql('CREATE INDEX IDX_7D3A72C515761DAB ON livret_acquis (competence_id)');
}
}