From 601dd0abd6fccd3c41cc4906a421ad43ca122b69 Mon Sep 17 00:00:00 2001 From: xiadc <251308692@qq.com> Date: Mon, 16 Jun 2025 11:16:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(database):=20=E6=B7=BB=E5=8A=A0=E7=AD=BE?= =?UTF-8?q?=E5=88=B0=E5=8A=9F=E8=83=BD=E7=9B=B8=E5=85=B3=E8=A1=A8=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 zy_sign_record 表,用于记录用户签到信息 - 新增 zy_sign_set 表,用于配置签到奖励设置 --- add.sql | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/add.sql b/add.sql index c28e966..c2b2256 100644 --- a/add.sql +++ b/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`; -- 已执行 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 \ No newline at end of file