| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 10 | final class Version20241215133617_Direction_Nullable extends AbstractMigration |
||
| 11 | { |
||
| 12 | public function getDescription(): string |
||
| 13 | { |
||
| 14 | return ''; |
||
| 15 | } |
||
| 16 | |||
| 17 | public function up(Schema $schema): void |
||
| 18 | { |
||
| 19 | $this->addSql('ALTER TABLE stu_flight_sig ALTER from_direction DROP NOT NULL'); |
||
| 20 | $this->addSql('ALTER TABLE stu_flight_sig ALTER to_direction DROP NOT NULL'); |
||
| 21 | $this->addSql('UPDATE stu_flight_sig SET from_direction = null WHERE from_direction = 0'); |
||
| 22 | $this->addSql('UPDATE stu_flight_sig SET to_direction = null WHERE to_direction = 0'); |
||
| 23 | } |
||
| 24 | |||
| 25 | public function down(Schema $schema): void |
||
| 26 | { |
||
| 27 | $this->addSql('UPDATE stu_flight_sig SET from_direction = 0 WHERE from_direction IS null'); |
||
| 28 | $this->addSql('UPDATE stu_flight_sig SET to_direction = 0 WHERE to_direction IS null'); |
||
| 29 | $this->addSql('ALTER TABLE stu_flight_sig ALTER from_direction SET NOT NULL'); |
||
| 30 | $this->addSql('ALTER TABLE stu_flight_sig ALTER to_direction SET NOT NULL'); |
||
| 31 | } |
||
| 33 |