Failed Conditions
Pull Request — master (#154)
by Adrien
03:16
created

Version20250423020439::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 24

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 24
c 1
b 0
f 0
dl 0
loc 24
ccs 0
cts 16
cp 0
rs 9.536
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Application\Migration;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
class Version20250423020439 extends AbstractMigration
11
{
12
    public function up(Schema $schema): void
13
    {
14
        $this->addSql(<<<'SQL'
15
                ALTER TABLE log CHANGE extra extra JSON DEFAULT '{}' NOT NULL
16
            SQL);
17
        $this->addSql(<<<'SQL'
18
                ALTER TABLE message CHANGE type type ENUM('register', 'reset_password', 'updated_user', 'confirmed_registration', 'user_pending_order', 'user_validated_order', 'admin_pending_order', 'admin_validated_order', 'request_membership_end', 'newsletter_subscription') NOT NULL
19
            SQL);
20
        $this->addSql(<<<'SQL'
21
                ALTER TABLE `order` CHANGE balance_chf balance_chf INT DEFAULT 0 NOT NULL, CHANGE balance_eur balance_eur INT DEFAULT 0 NOT NULL, CHANGE status status ENUM('pending', 'validated', 'canceled') DEFAULT 'pending' NOT NULL, CHANGE payment_method payment_method ENUM('datatrans', 'ebanking', 'bvr') NOT NULL
22
            SQL);
23
        $this->addSql(<<<'SQL'
24
                ALTER TABLE order_line CHANGE balance_chf balance_chf INT NOT NULL, CHANGE balance_eur balance_eur INT NOT NULL, CHANGE type type ENUM('other', 'paper', 'digital', 'both') NOT NULL, CHANGE additional_emails additional_emails JSON DEFAULT '[]' NOT NULL
25
            SQL);
26
        $this->addSql(<<<'SQL'
27
                ALTER TABLE product CHANGE price_per_unit_chf price_per_unit_chf INT DEFAULT 0 NOT NULL, CHANGE price_per_unit_eur price_per_unit_eur INT DEFAULT 0 NOT NULL, CHANGE type type ENUM('other', 'paper', 'digital', 'both') NOT NULL
28
            SQL);
29
        $this->addSql(<<<'SQL'
30
                ALTER TABLE session CHANGE dates dates JSON NOT NULL
31
            SQL);
32
        $this->addSql(<<<'SQL'
33
                ALTER TABLE subscription CHANGE price_per_unit_chf price_per_unit_chf INT DEFAULT 0 NOT NULL, CHANGE price_per_unit_eur price_per_unit_eur INT DEFAULT 0 NOT NULL, CHANGE type type ENUM('other', 'paper', 'digital', 'both') NOT NULL
34
            SQL);
35
        $this->addSql(<<<'SQL'
36
                ALTER TABLE user CHANGE role role ENUM('member', 'facilitator', 'administrator') DEFAULT 'member' NOT NULL, CHANGE subscription_type subscription_type ENUM('other', 'paper', 'digital', 'both') DEFAULT NULL, CHANGE membership membership ENUM('none', 'member') DEFAULT 'none' NOT NULL
37
            SQL);
38
    }
39
}
40