<?php declare(strict_types=1);
namespace Swag\BasicExample\Migration;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Migration\MigrationStep;
class Migration1612863838ExampleTranslation extends MigrationStep
public function getCreationTimestamp(): int
public function update(Connection $connection): void
CREATE TABLE IF NOT EXISTS `swag_example_translation` (
`swag_example_id` BINARY(16) NOT NULL,
`language_id` BINARY(16) NOT NULL,
`created_at` DATETIME(3) NOT NULL,
`updated_at` DATETIME(3) NULL,
PRIMARY KEY (`swag_example_id`, `language_id`),
CONSTRAINT `fk.swag_example_translation.swag_example_id` FOREIGN KEY (`swag_example_id`)
REFERENCES `swag_example` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk.swag_example_translation.language_id` FOREIGN KEY (`language_id`)
REFERENCES `language` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
DEFAULT CHARSET = utf8mb4
COLLATE = utf8mb4_unicode_ci;
$connection->executeStatement($query);
public function updateDestructive(Connection $connection): void