$translations =
$sorting['translations'
];
unset($sorting['translations'
]);
$connection->
insert(ProductSortingDefinition::ENTITY_NAME,
$sorting);
$translations =
new Translations( ['product_sorting_id' =>
$sorting['id'
], 'label' =>
$translations['de-DE'
]],
['product_sorting_id' =>
$sorting['id'
], 'label' =>
$translations['en-GB'
]] );
$this->
importTranslation('product_sorting_translation',
$translations,
$connection);
} } private function createTable(Connection
$connection): void
{ $connection->
executeStatement('
CREATE TABLE IF NOT EXISTS `product_sorting` (
`id` BINARY(16) NOT NULL,
`url_key` VARCHAR(255) NOT NULL,
`priority` INT(11) unsigned NOT NULL,
`active` TINYINT(1) NOt NULL DEFAULT 1,
`fields` JSON NOT NULL,
`created_at` DATETIME(3) NOT NULL,
`locked` TINYINT(1) NOT NULL DEFAULT 0,
`updated_at` DATETIME(3) NULL,
PRIMARY KEY (`id`),
CONSTRAINT `uniq.product_sorting.url_key` UNIQUE (`url_key`),
CONSTRAINT `json.product_sorting.fields` CHECK (JSON_VALID(`fields`))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
'
);