Total Complexity | 2 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class Version20140415140243 extends AbstractMigration |
||
12 | { |
||
13 | public function up(Schema $schema) |
||
14 | { |
||
15 | // this up() migration is auto-generated, please modify it to your needs |
||
16 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'."); |
||
17 | |||
18 | $this->addSql("ALTER TABLE event__tickets DROP FOREIGN KEY FK_66E295594C3A3BB"); |
||
19 | $this->addSql("ALTER TABLE event__tickets ADD CONSTRAINT FK_66E295594C3A3BB FOREIGN KEY (payment_id) REFERENCES payments (id) ON DELETE SET NULL"); |
||
20 | } |
||
21 | |||
22 | public function down(Schema $schema) |
||
23 | { |
||
24 | // this down() migration is auto-generated, please modify it to your needs |
||
25 | $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'."); |
||
26 | |||
27 | $this->addSql("ALTER TABLE event__tickets DROP FOREIGN KEY FK_66E295594C3A3BB"); |
||
28 | $this->addSql("ALTER TABLE event__tickets ADD CONSTRAINT FK_66E295594C3A3BB FOREIGN KEY (payment_id) REFERENCES payments (id) ON DELETE CASCADE"); |
||
29 | } |
||
31 |