DROP TABLE IF EXISTS wx_floting_layer;
DROP TABLE IF EXISTS wx_cuser_floting_layer;

create table wx_floating_layer(
  `id` bigint(20) NOT NULL COMMENT '主键ID',
  `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID',
  `cover_img` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图',
  `produce_id` bigint(20) DEFAULT NULL COMMENT '产品ID',
  `page_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '小程序跳转路径',
  `status` smallint(2) DEFAULT NULL COMMENT '0上线 1下线',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='首页浮层';


create table wx_cuser_floating_layer(
  `id` bigint(20) NOT NULL COMMENT '主键ID',
  `tenant_id` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '租户ID',
  `user_id` bigint(20) DEFAULT NULL COMMENT 'C端用户ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id_UNIQUE` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=DYNAMIC COMMENT='用户首页浮层记录';
