Passed
Push — master ( d7d5d4...7f71c1 )
by Jan
04:41
created

Version20220101170424::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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 Version20220101170424 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 sepa_exports (id INT AUTO_INCREMENT NOT NULL, number_of_payments INT NOT NULL, total_sum INT NOT NULL, sepa_message_id LONGTEXT NOT NULL, initiator_bic LONGTEXT NOT NULL, booking_date DATETIME DEFAULT NULL, description LONGTEXT NOT NULL, comment LONGTEXT NOT NULL, initiator_iban LONGTEXT NOT NULL, group_ulid BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:ulid)\', last_modified DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, creation_date DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, xml_name VARCHAR(255) DEFAULT NULL, xml_original_name VARCHAR(255) DEFAULT NULL, xml_mime_type VARCHAR(255) DEFAULT NULL, xml_size INT DEFAULT NULL, xml_dimensions LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:simple_array)\', PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
24
        $this->addSql('CREATE TABLE sepaexport_payment_order (sepaexport_id INT NOT NULL, payment_order_id INT NOT NULL, INDEX IDX_D6E88FB3FA78CB41 (sepaexport_id), INDEX IDX_D6E88FB3CD592F50 (payment_order_id), PRIMARY KEY(sepaexport_id, payment_order_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
25
        $this->addSql('ALTER TABLE sepaexport_payment_order ADD CONSTRAINT FK_D6E88FB3FA78CB41 FOREIGN KEY (sepaexport_id) REFERENCES sepa_exports (id) ON DELETE CASCADE');
26
        $this->addSql('ALTER TABLE sepaexport_payment_order ADD CONSTRAINT FK_D6E88FB3CD592F50 FOREIGN KEY (payment_order_id) REFERENCES payment_orders (id) ON DELETE CASCADE');
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 sepaexport_payment_order DROP FOREIGN KEY FK_D6E88FB3FA78CB41');
33
        $this->addSql('DROP TABLE sepa_exports');
34
        $this->addSql('DROP TABLE sepaexport_payment_order');
35
    }
36
}
37