<?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 Version20251002184525 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 profil DROP CONSTRAINT fk_e6d6b29793989168');
$this->addSql('DROP SEQUENCE type_profil_id_seq CASCADE');
$this->addSql('DROP TABLE type_profil');
$this->addSql('ALTER TABLE convention_signe DROP CONSTRAINT fk_561a2ad5d2415cf9');
$this->addSql('DROP INDEX idx_561a2ad5d2415cf9');
$this->addSql('ALTER TABLE convention_signe RENAME COLUMN type_convention_id TO activite_realisation_id');
$this->addSql('ALTER TABLE convention_signe ADD CONSTRAINT FK_561A2AD56B88DC67 FOREIGN KEY (activite_realisation_id) REFERENCES activite_realisation (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_561A2AD56B88DC67 ON convention_signe (activite_realisation_id)');
$this->addSql('ALTER TABLE menu DROP CONSTRAINT FK_7D053A93CCD7E912');
$this->addSql('ALTER TABLE menu ADD CONSTRAINT FK_7D053A93CCD7E912 FOREIGN KEY (menu_id) REFERENCES menu (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE profil DROP CONSTRAINT FK_E6D6B297B3E9C81');
$this->addSql('DROP INDEX idx_e6d6b29793989168');
$this->addSql('ALTER TABLE profil DROP type_profil_id');
$this->addSql('ALTER TABLE profil ADD CONSTRAINT FK_E6D6B297B3E9C81 FOREIGN KEY (niveau_id) REFERENCES niveau (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('CREATE SEQUENCE type_profil_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE type_profil (id SERIAL NOT NULL, name VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('ALTER TABLE profil DROP CONSTRAINT fk_e6d6b297b3e9c81');
$this->addSql('ALTER TABLE profil ADD type_profil_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE profil ADD CONSTRAINT fk_e6d6b29793989168 FOREIGN KEY (type_profil_id) REFERENCES type_profil (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE profil ADD CONSTRAINT fk_e6d6b297b3e9c81 FOREIGN KEY (niveau_id) REFERENCES niveau (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX idx_e6d6b29793989168 ON profil (type_profil_id)');
$this->addSql('ALTER TABLE convention_signe DROP CONSTRAINT FK_561A2AD56B88DC67');
$this->addSql('DROP INDEX IDX_561A2AD56B88DC67');
$this->addSql('ALTER TABLE convention_signe RENAME COLUMN activite_realisation_id TO type_convention_id');
$this->addSql('ALTER TABLE convention_signe ADD CONSTRAINT fk_561a2ad5d2415cf9 FOREIGN KEY (type_convention_id) REFERENCES type_convention (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX idx_561a2ad5d2415cf9 ON convention_signe (type_convention_id)');
$this->addSql('ALTER TABLE menu DROP CONSTRAINT fk_7d053a93ccd7e912');
$this->addSql('ALTER TABLE menu ADD CONSTRAINT fk_7d053a93ccd7e912 FOREIGN KEY (menu_id) REFERENCES menu (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
}