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

Migration1536233250MessageQueueStats   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 3
dl 0
loc 23
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Migration;
4
5
use Doctrine\DBAL\Connection;
6
use Shopware\Core\Framework\Migration\MigrationStep;
7
8
class Migration1536233250MessageQueueStats extends MigrationStep
9
{
10
    public function getCreationTimestamp(): int
11
    {
12
        return 1536233250;
13
    }
14
15
    public function update(Connection $connection): void
16
    {
17
        $connection->exec('
18
          CREATE TABLE message_queue_stats (
19
            `id` BINARY(16) NOT NULL PRIMARY KEY,          
20
            `name` VARCHAR(255) NOT NULL,
21
            `size` INT(11) NOT NULL DEFAULT 0,
22
            `created_at` DATETIME(3) NOT NULL,
23
            `updated_at` DATETIME(3) NULL,
24
            CONSTRAINT `uniq.message_queue_stats.name` UNIQUE(`name`),
25
            CONSTRAINT `check.message_queue_stats.size` CHECK (size >= 0)
26
        )');
27
    }
28
29
    public function updateDestructive(Connection $connection): void
30
    {
31
        // implement update destructive
32
    }
33
}
34