<?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 Version20250630060142 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 road_occupation_stage_parcel (road_occupation_stage_id UUID NOT NULL, parcel_id UUID NOT NULL, PRIMARY KEY(road_occupation_stage_id, parcel_id))');
$this->addSql('CREATE INDEX IDX_F7237A6BF4928E4 ON road_occupation_stage_parcel (road_occupation_stage_id)');
$this->addSql('CREATE INDEX IDX_F7237A6465E670C ON road_occupation_stage_parcel (parcel_id)');
$this->addSql('COMMENT ON COLUMN road_occupation_stage_parcel.road_occupation_stage_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN road_occupation_stage_parcel.parcel_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE road_occupation_stage_parcel ADD CONSTRAINT FK_F7237A6BF4928E4 FOREIGN KEY (road_occupation_stage_id) REFERENCES road_occupation_stage (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE road_occupation_stage_parcel ADD CONSTRAINT FK_F7237A6465E670C FOREIGN KEY (parcel_id) REFERENCES parcel (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('ALTER TABLE road_occupation_stage_parcel DROP CONSTRAINT FK_F7237A6BF4928E4');
$this->addSql('ALTER TABLE road_occupation_stage_parcel DROP CONSTRAINT FK_F7237A6465E670C');
$this->addSql('DROP TABLE road_occupation_stage_parcel');
}
}