Version20201021101147::down()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineMigrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
/**
11
 * Auto-generated Migration: Please modify to your needs!
12
 */
13
final class Version20201021101147 extends AbstractMigration
14
{
15
    public function getDescription() : string
16
    {
17
        return '';
18
    }
19
20
    public function up(Schema $schema) : void
21
    {
22
        // this up() migration is auto-generated, please modify it to your needs
23
        $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');
24
        $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');
25
        $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');
26
        $this->addSql('ALTER TABLE sylius_order CHANGE abandoned_email abandonedEmail TINYINT(1) NOT NULL');
27
    }
28
29
    public function down(Schema $schema) : void
30
    {
31
        // this down() migration is auto-generated, please modify it to your needs
32
        $this->addSql('ALTER TABLE bitbag_mollie_email_template_translation DROP FOREIGN KEY FK_42127E4A2C2AC5D3');
33
        $this->addSql('DROP TABLE bitbag_mollie_email_template');
34
        $this->addSql('DROP TABLE bitbag_mollie_email_template_translation');
35
        $this->addSql('ALTER TABLE sylius_order CHANGE abandonedemail abandoned_email TINYINT(1) NOT NULL');
36
    }
37
}
38