| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function up(Schema $schema): void |
||
| 12 | { |
||
| 13 | $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
||
| 14 | |||
| 15 | $this->addSql('ALTER TABLE subscription ADD illustration_id INT DEFAULT NULL'); |
||
| 16 | $this->addSql('ALTER TABLE subscription ADD CONSTRAINT FK_A3C664D35926566C FOREIGN KEY (illustration_id) REFERENCES image (id) ON DELETE CASCADE'); |
||
| 17 | $this->addSql('CREATE UNIQUE INDEX UNIQ_A3C664D35926566C ON subscription (illustration_id)'); |
||
| 18 | $this->addSql('ALTER TABLE product ADD illustration_id INT DEFAULT NULL'); |
||
| 19 | $this->addSql('ALTER TABLE product ADD CONSTRAINT FK_D34A04AD5926566C FOREIGN KEY (illustration_id) REFERENCES image (id) ON DELETE CASCADE'); |
||
| 20 | $this->addSql('CREATE UNIQUE INDEX UNIQ_D34A04AD5926566C ON product (illustration_id)'); |
||
| 21 | } |
||
| 23 |