feat(database): 添加签到功能相关表结构
- 新增 zy_sign_record 表,用于记录用户签到信息 - 新增 zy_sign_set 表,用于配置签到奖励设置
This commit is contained in:
27
add.sql
27
add.sql
@@ -5,3 +5,30 @@ ALTER TABLE `zy_club` ADD COLUMN `attention` int(11) NOT NULL DEFAULT 0 COMMENT
|
|||||||
|
|
||||||
ALTER TABLE `zy_circle` ADD COLUMN `top` int NOT NULL DEFAULT 0 COMMENT '置顶' AFTER `status`;
|
ALTER TABLE `zy_circle` ADD COLUMN `top` int NOT NULL DEFAULT 0 COMMENT '置顶' AFTER `status`;
|
||||||
-- 已执行 2025-05-31
|
-- 已执行 2025-05-31
|
||||||
|
|
||||||
|
|
||||||
|
CREATE TABLE `zy_sign_record` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`user_id` bigint(20) unsigned NOT NULL DEFAULT 0 COMMENT '用户id',
|
||||||
|
`date` date NOT NULL DEFAULT current_timestamp() COMMENT '签到日期',
|
||||||
|
`last` int(11) NOT NULL DEFAULT 1 COMMENT '已持续天数',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
KEY `user_id` (`user_id`,`last`) USING BTREE,
|
||||||
|
KEY `date` (`date`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='签到记录';
|
||||||
|
|
||||||
|
CREATE TABLE `zy_sign_set` (
|
||||||
|
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
|
||||||
|
`last` tinyint(4) NOT NULL DEFAULT 1 COMMENT '连续天数',
|
||||||
|
`chance1` tinyint(4) NOT NULL DEFAULT 0 COMMENT '概率1',
|
||||||
|
`coupon1_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '券1',
|
||||||
|
`chance2` tinyint(4) NOT NULL DEFAULT 0 COMMENT '概率2',
|
||||||
|
`coupon2_id` bigint(20) NOT NULL DEFAULT 0 COMMENT '券2',
|
||||||
|
`create_time` datetime NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
|
||||||
|
`update_time` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`id`) USING BTREE,
|
||||||
|
KEY `type` (`last`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='签到设置';
|
||||||
|
-- 已执行 2025-06-16
|
||||||
Reference in New Issue
Block a user