Passed
Branch master (bbfb46)
by Jan
22:41 queued 14:44
created

Migration1546422281AddGeneralSettingsTable   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 3
1
<?php declare(strict_types=1);
2
3
namespace SwagExample\Migration;
4
5
use Doctrine\DBAL\Connection;
6
use Shopware\Core\Framework\Migration\MigrationStep;
7
8
class Migration1546422281AddGeneralSettingsTable extends MigrationStep
9
{
10
    public function getCreationTimestamp(): int
11
    {
12
        return 1546422281;
13
    }
14
15
    public function update(Connection $connection): void
16
    {
17
        $query = <<<SQL
18
CREATE TABLE IF NOT EXISTS `swag_example_general_settings` (
19
    `id`                INT             NOT NULL,
20
    `example_setting`   VARCHAR(255)    NOT NULL,
21
    PRIMARY KEY (id)
22
)
23
    ENGINE = InnoDB
24
    DEFAULT CHARSET = utf8mb4
25
    COLLATE = utf8mb4_unicode_ci;
26
SQL;
27
28
        $connection->executeQuery($query);
29
    }
30
31
    public function updateDestructive(Connection $connection): void
32
    {
33
        // implement update destructive
34
    }
35
}
36