migrations/Version20260128140000.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.  * Add infrastructureTelecommunicationOnly and ordinalNumber fields to road occupation entities
  8.  */
  9. final class Version20260128140000 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Add infrastructureTelecommunicationOnly to road_occupation_stage and ordinalNumber to both road_occupation_stage and road_occupation';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('ALTER TABLE road_occupation_stage ADD infrastructure_telecommunication_only BOOLEAN DEFAULT NULL');
  18.         $this->addSql('ALTER TABLE road_occupation_stage ADD ordinal_number INT DEFAULT NULL');
  19.         $this->addSql('ALTER TABLE road_occupation ADD ordinal_number INT DEFAULT NULL');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         $this->addSql('ALTER TABLE road_occupation_stage DROP infrastructure_telecommunication_only');
  24.         $this->addSql('ALTER TABLE road_occupation_stage DROP ordinal_number');
  25.         $this->addSql('ALTER TABLE road_occupation DROP ordinal_number');
  26.     }
  27. }