Test Setup Failed
Pull Request — master (#487)
by Andrew
05:19
created

Version20111025000715   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 19
dl 0
loc 30
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Application\Migrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration,
6
    Doctrine\DBAL\Schema\Schema;
7
8
/**
9
 * Auto-generated Migration: Please modify to your need!
10
 */
11
class Version20111025000715 extends AbstractMigration
12
{
13
    public function up(Schema $schema)
14
    {
15
        // this up() migration is autogenerated, please modify it to your needs
16
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
17
        
18
        $this->addSql("ALTER TABLE event__tickets DROP FOREIGN KEY FK_66E295594C3A3BB");
19
        $this->addSql("ALTER TABLE event__tickets DROP FOREIGN KEY FK_66E2955971F7E88B");
20
        $this->addSql("ALTER TABLE event__tickets DROP FOREIGN KEY FK_66E29559A76ED395");
21
        $this->addSql("ALTER TABLE event__tickets ADD CONSTRAINT FK_66E295594C3A3BB FOREIGN KEY (payment_id) REFERENCES payments(id) ON UPDATE CASCADE ON DELETE CASCADE");
22
        $this->addSql("ALTER TABLE event__tickets ADD CONSTRAINT FK_66E2955971F7E88B FOREIGN KEY (event_id) REFERENCES event__events(id) ON UPDATE CASCADE ON DELETE CASCADE");
23
        $this->addSql("ALTER TABLE event__tickets ADD CONSTRAINT FK_66E29559A76ED395 FOREIGN KEY (user_id) REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE");
24
        $this->addSql("ALTER TABLE payments DROP FOREIGN KEY FK_65D29B32A76ED395");
25
        $this->addSql("ALTER TABLE payments ADD CONSTRAINT FK_65D29B32A76ED395 FOREIGN KEY (user_id) REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE");
26
    }
27
28
    public function down(Schema $schema)
29
    {
30
        // this down() migration is autogenerated, please modify it to your needs
31
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
32
        
33
        $this->addSql("ALTER TABLE event__tickets DROP FOREIGN KEY FK_66E2955971F7E88B");
34
        $this->addSql("ALTER TABLE event__tickets DROP FOREIGN KEY FK_66E29559A76ED395");
35
        $this->addSql("ALTER TABLE event__tickets DROP FOREIGN KEY FK_66E295594C3A3BB");
36
        $this->addSql("ALTER TABLE event__tickets ADD CONSTRAINT FK_66E2955971F7E88B FOREIGN KEY (event_id) REFERENCES event__events(id)");
37
        $this->addSql("ALTER TABLE event__tickets ADD CONSTRAINT FK_66E29559A76ED395 FOREIGN KEY (user_id) REFERENCES users(id)");
38
        $this->addSql("ALTER TABLE event__tickets ADD CONSTRAINT FK_66E295594C3A3BB FOREIGN KEY (payment_id) REFERENCES payments(id)");
39
        $this->addSql("ALTER TABLE payments DROP FOREIGN KEY FK_65D29B32A76ED395");
40
        $this->addSql("ALTER TABLE payments ADD CONSTRAINT FK_65D29B32A76ED395 FOREIGN KEY (user_id) REFERENCES users(id)");
41
    }
42
}
43