-- 抖店商品奖励规则表
CREATE TABLE IF NOT EXISTS douyin_product_rewards (
    id BIGINT AUTO_INCREMENT PRIMARY KEY,
    product_id VARCHAR(64) NOT NULL COMMENT '抖店商品ID',
    product_name VARCHAR(255) NOT NULL DEFAULT '' COMMENT '商品名称（便于识别）',
    reward_type VARCHAR(32) NOT NULL COMMENT '奖励类型: game_ticket/coupon/points/product/item_card/title',
    reward_payload JSON COMMENT '奖励参数JSON',
    quantity INT NOT NULL DEFAULT 1 COMMENT '发放数量',
    status TINYINT NOT NULL DEFAULT 1 COMMENT '状态: 1=启用 0=禁用',
    created_at DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3),
    updated_at DATETIME(3) DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
    UNIQUE KEY uk_product_id (product_id),
    KEY idx_status (status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='抖店商品奖励规则';
