bindbox-game/migrations/task_level_quota.sql

18 lines
647 B
SQL
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 任务级限量功能数据库迁移
-- 日期: 2026-02-16
-- 1. 为 task_center_tasks 表添加限量字段
ALTER TABLE `task_center_tasks`
ADD COLUMN `quota` INT NOT NULL DEFAULT 0 COMMENT '总限额0表示不限' AFTER `visibility`,
ADD COLUMN `claimed_count` INT NOT NULL DEFAULT 0 COMMENT '已领取数' AFTER `quota`;
-- 2. 从 task_center_task_tiers 表移除限量字段
ALTER TABLE `task_center_task_tiers`
DROP COLUMN `quota`,
DROP COLUMN `claimed_count`;
-- 说明:
-- - quota: 任务总限额,0表示不限量
-- - claimed_count: 已领取数量,用户每次领取时原子性增加
-- - 所有档位共享任务的总限额