Version20201021101147::getDescription()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace BitBag\SyliusMolliePlugin\Migrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
final class Version20201021101147 extends AbstractMigration
11
{
12
    public function getDescription(): string
13
    {
14
        return '';
15
    }
16
17
    public function up(Schema $schema): void
18
    {
19
        // this up() migration is auto-generated, please modify it to your needs
20
        $this->addSql('CREATE TABLE bitbag_mollie_email_template (id INT AUTO_INCREMENT NOT NULL, type VARCHAR(255) NOT NULL, style TEXT DEFAULT NULL, UNIQUE INDEX UNIQ_835AAD848CDE5729 (type), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB');
21
        $this->addSql('CREATE TABLE bitbag_mollie_email_template_translation (id INT AUTO_INCREMENT NOT NULL, translatable_id INT NOT NULL, name VARCHAR(255) DEFAULT NULL, subject VARCHAR(255) DEFAULT NULL, content TEXT DEFAULT NULL, locale VARCHAR(255) NOT NULL, INDEX IDX_42127E4A2C2AC5D3 (translatable_id), UNIQUE INDEX bitbag_mollie_email_template_translation_uniq_trans (translatable_id, locale), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB');
22
        $this->addSql('ALTER TABLE bitbag_mollie_email_template_translation ADD CONSTRAINT FK_42127E4A2C2AC5D3 FOREIGN KEY (translatable_id) REFERENCES bitbag_mollie_email_template (id) ON DELETE CASCADE');
23
    }
24
25
    public function down(Schema $schema): void
26
    {
27
        // this down() migration is auto-generated, please modify it to your needs
28
        $this->addSql('ALTER TABLE bitbag_mollie_email_template_translation DROP FOREIGN KEY FK_42127E4A2C2AC5D3');
29
        $this->addSql('DROP TABLE bitbag_mollie_email_template');
30
        $this->addSql('DROP TABLE bitbag_mollie_email_template_translation');
31
    }
32
}
33