| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | final class Version20201210100006 extends AbstractMigrationChamilo |
||
| 11 | { |
||
| 12 | public function getDescription(): string |
||
| 13 | { |
||
| 14 | return 'Add custom_image_id field to c_link table and set up the foreign key to asset table.'; |
||
| 15 | } |
||
| 16 | |||
| 17 | public function up(Schema $schema): void |
||
| 18 | { |
||
| 19 | // Add the new column and foreign key |
||
| 20 | $this->addSql(' |
||
| 21 | ALTER TABLE c_link |
||
| 22 | ADD custom_image_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', |
||
| 23 | ADD CONSTRAINT FK_9209C2A0D877C209 FOREIGN KEY (custom_image_id) REFERENCES asset (id) ON DELETE SET NULL |
||
| 24 | '); |
||
| 25 | } |
||
| 26 | |||
| 27 | public function down(Schema $schema): void |
||
| 31 | ALTER TABLE c_link |
||
| 32 | DROP FOREIGN KEY FK_9209C2A0D877C209, |
||
| 33 | DROP custom_image_id |
||
| 37 |