|
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 Migration1536233220PluginTranslation extends MigrationStep |
|
9
|
|
|
{ |
|
10
|
|
|
public function getCreationTimestamp(): int |
|
11
|
|
|
{ |
|
12
|
|
|
return 1536233220; |
|
13
|
|
|
} |
|
14
|
|
|
|
|
15
|
|
|
public function update(Connection $connection): void |
|
16
|
|
|
{ |
|
17
|
|
|
$connection->executeQuery(' |
|
18
|
|
|
CREATE TABLE `plugin_translation` ( |
|
19
|
|
|
`plugin_id` BINARY(16) NOT NULL, |
|
20
|
|
|
`language_id` BINARY(16) NOT NULL, |
|
21
|
|
|
`label` VARCHAR(255) COLLATE utf8mb4_unicode_ci NULL, |
|
22
|
|
|
`description` LONGTEXT COLLATE utf8mb4_unicode_ci NULL, |
|
23
|
|
|
`manufacturer_link` TEXT COLLATE utf8mb4_unicode_ci NULL, |
|
24
|
|
|
`support_link` TEXT COLLATE utf8mb4_unicode_ci NULL, |
|
25
|
|
|
`changelog` JSON NULL, |
|
26
|
|
|
`custom_fields` JSON NULL, |
|
27
|
|
|
`created_at` DATETIME(3) NOT NULL, |
|
28
|
|
|
`updated_at` DATETIME(3) NULL, |
|
29
|
|
|
PRIMARY KEY (`plugin_id`, `language_id`), |
|
30
|
|
|
CONSTRAINT `json.plugin_translation.changelog` CHECK (JSON_VALID(`changelog`)), |
|
31
|
|
|
CONSTRAINT `json.plugin_translation.custom_fields` CHECK (JSON_VALID(`custom_fields`)), |
|
32
|
|
|
CONSTRAINT `fk.plugin_translation.plugin_id` FOREIGN KEY (`plugin_id`) |
|
33
|
|
|
REFERENCES `plugin` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, |
|
34
|
|
|
CONSTRAINT `fk.plugin_translation.language_id` FOREIGN KEY (`language_id`) |
|
35
|
|
|
REFERENCES `language` (`id`) ON DELETE CASCADE ON UPDATE CASCADE |
|
36
|
|
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; |
|
37
|
|
|
'); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public function updateDestructive(Connection $connection): void |
|
41
|
|
|
{ |
|
42
|
|
|
} |
|
43
|
|
|
} |
|
44
|
|
|
|