| Total Complexity | 3 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class Version20250619092054 extends AbstractMigration |
||
| 11 | { |
||
| 12 | public function getDescription(): string |
||
| 13 | { |
||
| 14 | return 'Optimized foreign key relations.'; |
||
| 15 | } |
||
| 16 | |||
| 17 | public function up(Schema $schema): void |
||
| 18 | { |
||
| 19 | $this->addSql(<<<'SQL' |
||
| 20 | ALTER TABLE stu_deals ADD CONSTRAINT FK_6DAE42FC4448F8DA FOREIGN KEY (faction_id) REFERENCES stu_factions (id) NOT DEFERRABLE INITIALLY IMMEDIATE |
||
| 21 | SQL); |
||
| 22 | $this->addSql(<<<'SQL' |
||
| 23 | CREATE INDEX IDX_6DAE42FC4448F8DA ON stu_deals (faction_id) |
||
| 24 | SQL); |
||
| 25 | $this->addSql(<<<'SQL' |
||
| 26 | ALTER INDEX planet_type_idx RENAME TO IDX_5C1857F8506FDB14 |
||
| 27 | SQL); |
||
| 28 | $this->addSql(<<<'SQL' |
||
| 29 | ALTER TABLE stu_user ALTER race DROP NOT NULL |
||
| 30 | SQL); |
||
| 31 | } |
||
| 32 | |||
| 33 | public function down(Schema $schema): void |
||
| 34 | { |
||
| 35 | $this->addSql(<<<'SQL' |
||
| 36 | ALTER TABLE stu_deals DROP CONSTRAINT FK_6DAE42FC4448F8DA |
||
| 37 | SQL); |
||
| 38 | $this->addSql(<<<'SQL' |
||
| 39 | DROP INDEX IDX_6DAE42FC4448F8DA |
||
| 40 | SQL); |
||
| 41 | $this->addSql(<<<'SQL' |
||
| 42 | ALTER TABLE stu_user ALTER race SET NOT NULL |
||
| 43 | SQL); |
||
| 44 | $this->addSql(<<<'SQL' |
||
| 45 | ALTER INDEX idx_5c1857f8506fdb14 RENAME TO planet_type_idx |
||
| 49 |