| Total Complexity | 3 |
| Total Lines | 22 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | final class Version20240705092745_StarSystem extends AbstractMigration |
||
| 12 | { |
||
| 13 | #[Override] |
||
| 14 | public function getDescription(): string |
||
| 15 | { |
||
| 16 | return 'Removes the following obsolete fields from stu_systems: cx, cy'; |
||
| 17 | } |
||
| 18 | |||
| 19 | #[Override] |
||
| 20 | public function up(Schema $schema): void |
||
| 21 | { |
||
| 22 | $this->addSql('DROP INDEX coordinate_idx;'); |
||
| 23 | $this->addSql('ALTER TABLE stu_systems DROP cx;'); |
||
| 24 | $this->addSql('ALTER TABLE stu_systems DROP cy;'); |
||
| 25 | } |
||
| 26 | |||
| 27 | #[Override] |
||
| 28 | public function down(Schema $schema): void |
||
| 29 | { |
||
| 30 | $this->addSql('ALTER TABLE stu_systems ADD cx SMALLINT DEFAULT NULL;'); |
||
| 31 | $this->addSql('ALTER TABLE stu_systems ADD cy SMALLINT DEFAULT NULL;'); |
||
| 32 | $this->addSql('CREATE INDEX coordinate_idx ON stu_systems (cx, cy);'); |
||
| 33 | } |
||
| 35 |