admin管理员组文章数量:1390555
Internal Server Error
An exception occurred while executing a query: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'swag_example_size' for key 'custom_field.uniq.custom_field.name'
this is my migration
<?php declare(strict_types=1);
namespace SwagShopFinder\Migration;
use Doctrine\DBAL\Connection;
use Shopware\Core\Framework\Migration\MigrationStep;
/**
* @internal
*/
class Migration1741862942 extends MigrationStep
{
public function getCreationTimestamp(): int
{
return 1741862942;
}
public function update(Connection $connection): void
{
$connection->exec("CREATE TABLE IF NOT EXISTS swag_shop_finder (
`id` BINARY(16) NOT NULL,
active TINYINT(1) NULL DEFAULT '0',
name VARCHAR(255) NOT NULL,
street VARCHAR(255) NOT NULL,
post_code VARCHAR(255) NOT NULL,
city VARCHAR(255) NOT NULL,
url VARCHAR(255) NULL,
telephone VARCHAR(255) NULL,
open_times LONGTEXT NULL,
country_id BINARY(16) NULL,
createdAt DATETIME(3),
updatedAt DATETIME(3),
PRIMARY KEY (id),
KEY `fk_swag_shop_finder_country_id` (country_id),
CONSTRAINT `fk_swag_shop_finder_country_id`
FOREIGN KEY (country_id)
REFERENCES country (id)
ON DELETE RESTRICT
ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
");
}
}
本文标签: sqlShopware 6 1062 error when trying to run a migrationStack Overflow
版权声明:本文标题:sql - Shopware 6 1062 error when trying to run a migration - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744704111a2620737.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论