<?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 Version20240709074653 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_road_occupation_type (id UUID NOT NULL, created_by UUID DEFAULT NULL, updated_by UUID DEFAULT NULL, name VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, updated_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, deleted_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_D73922895E237E06 ON dict_road_occupation_type (name)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_D739228977153098 ON dict_road_occupation_type (code)');
$this->addSql('CREATE INDEX IDX_D7392289DE12AB56 ON dict_road_occupation_type (created_by)');
$this->addSql('CREATE INDEX IDX_D739228916FE72E1 ON dict_road_occupation_type (updated_by)');
$this->addSql('COMMENT ON COLUMN dict_road_occupation_type.id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN dict_road_occupation_type.created_by IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN dict_road_occupation_type.updated_by IS \'(DC2Type:uuid)\'');
$this->addSql('ALTER TABLE dict_road_occupation_type ADD CONSTRAINT FK_D7392289DE12AB56 FOREIGN KEY (created_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE dict_road_occupation_type ADD CONSTRAINT FK_D739228916FE72E1 FOREIGN KEY (updated_by) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE road_occupation ADD location_decision_date DATE DEFAULT NULL');
}
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_road_occupation_type DROP CONSTRAINT FK_D7392289DE12AB56');
$this->addSql('ALTER TABLE dict_road_occupation_type DROP CONSTRAINT FK_D739228916FE72E1');
$this->addSql('DROP TABLE dict_road_occupation_type');
$this->addSql('ALTER TABLE road_occupation DROP location_decision_date');
}
}