migrations/Version20260903072910.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Migracja tworząca tabelę słownika dróg (dict_road) - Redmine #29872
  8.  */
  9. final class Version20260903072910 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Create dict_road table (roads dictionary synced from SmartGEM)';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('CREATE TABLE dict_road (id UUID NOT NULL, external_id VARCHAR(50) NOT NULL, road_number VARCHAR(50) NOT NULL, road_name VARCHAR(255) DEFAULT NULL, is_active BOOLEAN DEFAULT true NOT NULL, PRIMARY KEY(id))');
  18.         $this->addSql('CREATE UNIQUE INDEX UNIQ_C08258E9F75D7B0 ON dict_road (external_id)');
  19.         $this->addSql('COMMENT ON COLUMN dict_road.id IS \'(DC2Type:uuid)\'');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         $this->addSql('DROP TABLE dict_road');
  24.     }
  25. }