This commit is contained in:
Yangxt
2026-09-30 11:11:54 +08:00
parent cb9b7a4bd4
commit 2fb57ec490
160 changed files with 14764 additions and 53 deletions
+19
View File
@@ -0,0 +1,19 @@
-- 表:wms_product
-- 用途:商品。SKU 的上层商品,属于一个货主。
-- 约定:InnoDB / utf8mb4 / 无外键,表间按业务编码关联。详见 docs/database/00-conventions.md
-- 说明:product_code 在租户内唯一,不按货主再分一层。
CREATE TABLE `wms_product` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '内部主键',
`tenant_code` VARCHAR(32) NOT NULL COMMENT '租户编码',
`customer_code` VARCHAR(32) NOT NULL COMMENT '货主编码',
`product_code` VARCHAR(64) NOT NULL COMMENT '商品编码,租户内唯一',
`product_name` VARCHAR(128) NOT NULL COMMENT '商品名称',
`status` VARCHAR(32) NOT NULL DEFAULT 'active' COMMENT 'active 启用,disabled 停用',
`remark` VARCHAR(500) NOT NULL DEFAULT '' COMMENT '备注',
`created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) COMMENT '创建时间',
`updated_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `uk_tenant_product_code` (`tenant_code`, `product_code`),
KEY `idx_tenant_customer` (`tenant_code`, `customer_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商品';