20260811_home_page_module_config.sql 950 B

123456789101112131415
  1. -- 门店首页模块配置落库:原仅存 Redis 的 modules/topNav/banner/navGrid/hot/new/pullGoods
  2. -- 统一按门店(shopId)维度落一张通用配置表,moduleKey 区分具体模块,configValue 存 JSON
  3. CREATE TABLE IF NOT EXISTS `xhHomePageModuleConfig` (
  4. `id` int(11) NOT NULL AUTO_INCREMENT,
  5. `mainId` int(11) NOT NULL DEFAULT 0 COMMENT '中央id',
  6. `shopId` int(11) NOT NULL DEFAULT 0 COMMENT '门店id',
  7. `moduleKey` varchar(32) NOT NULL DEFAULT '' COMMENT '配置项标识:modules/topNav/banner/navGrid/hot/new/pullGoods',
  8. `configValue` text COMMENT '配置内容JSON,结构随moduleKey而定',
  9. `addTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  10. `updateTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  11. PRIMARY KEY (`id`),
  12. UNIQUE KEY `uk_shop_module` (`shopId`,`moduleKey`),
  13. KEY `mainId` (`mainId`)
  14. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='门店首页模块配置';