Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 10 |
Ratio | 100 % |
Changes | 0 |
1 | <?php |
||
30 | View Code Duplication | public function down(Schema $schema) |
|
31 | { |
||
32 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
||
33 | |||
34 | $this->addSql('ALTER TABLE vic_view DROP FOREIGN KEY FK_FAA91F341341DB46;'); |
||
35 | $this->addSql('ALTER TABLE vic_widget DROP FOREIGN KEY FK_57DF2B232B7846BB;'); |
||
36 | $this->addSql('ALTER TABLE vic_widget DROP FOREIGN KEY FK_57DF2B231341DB46;'); |
||
37 | $this->addSql('RENAME TABLE vic_entity_proxy TO vic_entity_proxy_new;'); |
||
38 | $this->addSql('CREATE TABLE `vic_entity_proxy` (`id` int(11) NOT NULL AUTO_INCREMENT, `article_id` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `UNIQ_2E15B1BA7294869C` (`article_id`), CONSTRAINT `FK_2E15B1BA7294869C` FOREIGN KEY (`article_id`) REFERENCES `vic_article` (`id`) ON DELETE CASCADE) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;'); |
||
39 | } |
||
40 | } |
||
41 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.