<?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 Version20220124192026 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 salles (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, intitule VARCHAR(255) NOT NULL, etat INT NOT NULL, INDEX IDX_799D45AAF6BD1646 (site_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE salles ADD CONSTRAINT FK_799D45AAF6BD1646 FOREIGN KEY (site_id) REFERENCES sites (id)');
$this->addSql('ALTER TABLE formations ADD referent_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE formations ADD CONSTRAINT FK_4090213735E47E35 FOREIGN KEY (referent_id) REFERENCES formateurs (id)');
$this->addSql('CREATE INDEX IDX_4090213735E47E35 ON formations (referent_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE salles');
$this->addSql('ALTER TABLE formations DROP FOREIGN KEY FK_4090213735E47E35');
$this->addSql('DROP INDEX IDX_4090213735E47E35 ON formations');
$this->addSql('ALTER TABLE formations DROP referent_id');
}
}