| Total Complexity | 3 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | final class Version20240806141232 extends AbstractMigration |
||
| 12 | { |
||
| 13 | public function getDescription(): string |
||
| 14 | { |
||
| 15 | return 'Add mining queue entity'; |
||
| 16 | } |
||
| 17 | |||
| 18 | public function up(Schema $schema): void |
||
| 19 | { |
||
| 20 | |||
| 21 | $this->addSql('CREATE TABLE stu_mining_queue (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, ship_id INT NOT NULL, location_mining_id INT NOT NULL, PRIMARY KEY(id))'); |
||
| 22 | $this->addSql('CREATE INDEX IDX_BBFEF8C427D56C25 ON stu_mining_queue (location_mining_id)'); |
||
| 23 | $this->addSql('CREATE UNIQUE INDEX UNIQ_BBFEF8C4C256317D ON stu_mining_queue (ship_id)'); |
||
| 24 | $this->addSql('ALTER TABLE stu_mining_queue ADD CONSTRAINT FK_BBFEF8C427D56C25 FOREIGN KEY (location_mining_id) REFERENCES stu_location_mining (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 25 | $this->addSql('ALTER TABLE stu_mining_queue ADD CONSTRAINT FK_BBFEF8C4C256317D FOREIGN KEY (ship_id) REFERENCES stu_ships (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); |
||
| 26 | } |
||
| 27 | |||
| 28 | public function down(Schema $schema): void |
||
| 34 | } |
||
| 35 | } |