Test Setup Failed
Pull Request — master (#487)
by Andrew
06:00
created

Version20181105145541   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 21
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Application\Migrations;
4
5
use Doctrine\DBAL\Migrations\AbstractMigration;
6
use Doctrine\DBAL\Schema\Schema;
7
8
/**
9
 * Auto-generated Migration: Please modify to your needs!
10
 */
11
class Version20181105145541 extends AbstractMigration
12
{
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('CREATE TABLE wayforpay_logs (id INT AUTO_INCREMENT NOT NULL, payment_id INT DEFAULT NULL, date DATETIME NOT NULL, status VARCHAR(255) NOT NULL, responseData LONGTEXT NOT NULL, fwdaysResponse LONGTEXT NOT NULL, INDEX IDX_B473FBBB4C3A3BB (payment_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
21
        $this->addSql('ALTER TABLE wayforpay_logs ADD CONSTRAINT FK_B473FBBB4C3A3BB FOREIGN KEY (payment_id) REFERENCES payments (id)');
22
    }
23
24
    /**
25
     * @param Schema $schema
26
     */
27
    public function down(Schema $schema)
28
    {
29
        $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
30
31
        $this->addSql('DROP TABLE wayforpay_logs');
32
    }
33
}
34