Passed
Push — trunk ( fb06e2...91b192 )
by Christian
11:15 queued 12s
created

updateDestructive()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
nc 1
nop 1
dl 0
loc 2
rs 10
c 1
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Elasticsearch\Migration\V6_5;
4
5
use Doctrine\DBAL\Connection;
6
use Shopware\Core\Framework\DataAbstractionLayer\Dbal\EntityDefinitionQueryHelper;
7
use Shopware\Core\Framework\Log\Package;
8
use Shopware\Core\Framework\Migration\MigrationStep;
9
10
/**
11
 * @internal
12
 */
13
#[Package('core')]
14
class Migration1689084023AdminElasticsearchIndexTask extends MigrationStep
15
{
16
    public function getCreationTimestamp(): int
17
    {
18
        return 1689084023;
19
    }
20
21
    public function update(Connection $connection): void
22
    {
23
        if (EntityDefinitionQueryHelper::tableExists($connection, 'admin_elasticsearch_index_task')) {
24
            return;
25
        }
26
27
        $connection->executeStatement('
28
CREATE TABLE IF NOT EXISTS `admin_elasticsearch_index_task` (
29
  `id` binary(16) NOT NULL,
30
  `index` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
31
  `alias` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
32
  `entity` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
33
  `doc_count` int(11) NOT NULL,
34
  PRIMARY KEY (`id`)
35
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
36
        ');
37
    }
38
39
    public function updateDestructive(Connection $connection): void
40
    {
41
    }
42
}
43