Files
ClassManager/sql/upgrades/v1.7.sql
2026-05-26 13:47:01 +08:00

32 lines
1.2 KiB
SQL
Raw 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.
-- ===========================================
-- 班级操行分管理系统 - 升级至 v1.7
-- 字符集: utf8mb4
--
-- 说明: 此脚本用于在已有数据库中创建版本管理系统。
-- 适用于从 v1.7 之前的版本升级。
--
-- 变更内容:
-- 1. 创建 system_settings 表(用于存储版本号等系统配置)
-- 2. 插入初始版本号 1.7
--
-- 兼容性: 使用 IF NOT EXISTS 实现幂等phpMyAdmin 可直接执行
-- ===========================================
-- ===========================================
-- 升级步骤 1: 创建 system_settings 表
-- ===========================================
CREATE TABLE IF NOT EXISTS `system_settings` (
`setting_key` VARCHAR(50) PRIMARY KEY,
`setting_value` VARCHAR(255) NOT NULL,
`updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- ===========================================
-- 升级步骤 2: 插入初始版本号
-- ===========================================
INSERT INTO `system_settings` (`setting_key`, `setting_value`)
VALUES ('db_version', '1.7')
ON DUPLICATE KEY UPDATE `setting_value` = '1.7';