Total Complexity | 6 |
Total Lines | 25 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class Version20211008133540 extends AbstractMigrationChamilo |
||
11 | { |
||
12 | public function getDescription(): string |
||
15 | } |
||
16 | |||
17 | public function up(Schema $schema): void |
||
18 | { |
||
19 | $table = $schema->getTable('c_tool_intro'); |
||
20 | |||
21 | if ($table->hasColumn('c_tool_id')) { |
||
22 | if (!$table->hasForeignKey('FK_D705267B1DF6B517')) { |
||
23 | $this->addSql( |
||
24 | 'ALTER TABLE c_tool_intro ADD CONSTRAINT FK_D705267B1DF6B517 FOREIGN KEY (c_tool_id) REFERENCES c_tool (iid);' |
||
25 | ); |
||
26 | } |
||
27 | if (!$table->hasIndex('IDX_D705267B1DF6B517')) { |
||
28 | $this->addSql('CREATE INDEX IDX_D705267B1DF6B517 ON c_tool_intro (c_tool_id);'); |
||
29 | } |
||
30 | } |
||
31 | } |
||
32 | |||
33 | public function down(Schema $schema): void |
||
35 | } |
||
36 | } |
||
37 |