-- 艺人关联商品表
CREATE TABLE IF NOT EXISTS `kylin_artist_product` (
    `mid` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
    `relation_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '关联记录ID',
    `artist_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '艺人ID',
    `spu_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '商品SPU ID',
    `sort` int DEFAULT 0 COMMENT '排序权重，越大越靠前',
    `status` tinyint DEFAULT 1 COMMENT '1启用 0禁用',
    `created_at` datetime DEFAULT NULL COMMENT '创建时间',
    `updated_at` datetime DEFAULT NULL COMMENT '更新时间',
    PRIMARY KEY (`mid`),
    UNIQUE KEY `uk_relation_id` (`relation_id`),
    UNIQUE KEY `uk_artist_spu` (`artist_id`, `spu_id`),
    KEY `idx_artist_id` (`artist_id`),
    KEY `idx_spu_id` (`spu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='艺人关联商品';
