|
@@ 16-25 (lines=10) @@
|
| 13 |
|
/** |
| 14 |
|
* @param Schema $schema |
| 15 |
|
*/ |
| 16 |
|
public function up(Schema $schema) |
| 17 |
|
{ |
| 18 |
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.'); |
| 19 |
|
|
| 20 |
|
$this->addSql('ALTER TABLE vic_view ADD CONSTRAINT FK_FAA91F341341DB46 FOREIGN KEY (entityProxy_id) REFERENCES vic_entity_proxy_new (id) ON DELETE CASCADE;'); |
| 21 |
|
$this->addSql('ALTER TABLE vic_widget ADD CONSTRAINT FK_57DF2B232B7846BB FOREIGN KEY (related_business_entity_id) REFERENCES vic_business_entity (id) ON DELETE CASCADE;'); |
| 22 |
|
$this->addSql('ALTER TABLE vic_widget ADD CONSTRAINT FK_57DF2B231341DB46 FOREIGN KEY (entityProxy_id) REFERENCES vic_entity_proxy_new (id) ON DELETE CASCADE;'); |
| 23 |
|
$this->addSql('DROP TABLE vic_entity_proxy;'); |
| 24 |
|
$this->addSql('RENAME TABLE vic_entity_proxy_new TO vic_entity_proxy;'); |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
/** |
| 28 |
|
* @param Schema $schema |
|
@@ 30-39 (lines=10) @@
|
| 27 |
|
/** |
| 28 |
|
* @param Schema $schema |
| 29 |
|
*/ |
| 30 |
|
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 |
|
|