Passed
Push — master ( 4a0866...4607f2 )
by Adrien
07:21
created

Version20190403060542   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A up() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Migration;
6
7
use Doctrine\DBAL\Schema\Schema;
8
9
class Version20190403060542 extends AbstractMigration
10
{
11
    public function up(Schema $schema): void
12
    {
13
        $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.');
14
15
        $this->addSql('ALTER TABLE bookable ADD credit_account_id INT DEFAULT NULL');
16
        $this->addSql('ALTER TABLE bookable ADD CONSTRAINT FK_A10B81246813E404 FOREIGN KEY (credit_account_id) REFERENCES account (id) ON DELETE CASCADE');
17
        $this->addSql('CREATE INDEX IDX_A10B81246813E404 ON bookable (credit_account_id)');
18
    }
19
}
20