<?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 Version20250616053511 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 dict_gmina (id UUID NOT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_144E710A5E237E06 ON dict_gmina (name)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_144E710A77153098 ON dict_gmina (code)');
$this->addSql('COMMENT ON COLUMN dict_gmina.id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE dict_obreb ADD gmina_id UUID DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN dict_obreb.gmina_id IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE dict_obreb ADD CONSTRAINT FK_16D3EE7D460E4014 FOREIGN KEY (gmina_id) REFERENCES dict_gmina (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_16D3EE7D460E4014 ON dict_obreb (gmina_id)');
}
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 dict_obreb DROP CONSTRAINT FK_16D3EE7D460E4014');
$this->addSql('DROP TABLE dict_gmina');
$this->addSql('DROP INDEX IDX_16D3EE7D460E4014');
$this->addSql('ALTER TABLE dict_obreb DROP gmina_id');
}
}