From 3acd089cf796c06b60e0069c96536caab594692b Mon Sep 17 00:00:00 2001 From: Nick Zeng Date: Thu, 13 Nov 2025 16:41:56 +0800 Subject: [PATCH] update sku mapping config --- backend/migrations/2025_11_13_068522_create_skus_mapping.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/migrations/2025_11_13_068522_create_skus_mapping.php b/backend/migrations/2025_11_13_068522_create_skus_mapping.php index b3e52ec..a547394 100644 --- a/backend/migrations/2025_11_13_068522_create_skus_mapping.php +++ b/backend/migrations/2025_11_13_068522_create_skus_mapping.php @@ -30,8 +30,9 @@ return new class extends Migration $table->text('note')->nullable()->default(null)->comment('备注信息'); $table->timestampsTz(); - // 创建联合唯一索引 - $table->unique(['platform_id', 'platform_product_id', 'origin_sku'], 'uk_platform_product_origin'); + // 创建联合唯一索引:确保同一平台的同一产品只能有一条映射记录 + // 原始 SKU 的约束由业务侧实现 + $table->unique(['platform_id', 'platform_product_id'], 'uk_platform_product'); }); }