refactor: 拆分数据库sql设计文件

This commit is contained in:
2026-08-10 22:43:16 +08:00
parent cf537d52e3
commit f0a08444c5
25 changed files with 1003 additions and 1798 deletions
@@ -0,0 +1,25 @@
-- ========================================
-- 系统-License 表设计
-- ========================================
-- ========================================
-- License 授权表(当前部署生效的 License)
-- ========================================
DROP TABLE IF EXISTS `sys_license`;
CREATE TABLE `sys_license` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '主键',
`company_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '授权公司名称',
`edition` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '版本(trial/enterprise/unlimited)',
`machine_fingerprint` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '绑定的机器指纹(SaaS 为 *)',
`installation_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '安装ID(machine-id)',
`license_key` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'License JWT',
`jti` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT 'JWT 唯一标识(吊销用)',
`issued_at` timestamp NOT NULL COMMENT '签发时间',
`expires_at` timestamp NOT NULL COMMENT '过期时间',
`activated_at` timestamp NOT NULL COMMENT '激活时间',
`is_active` tinyint UNSIGNED NOT NULL DEFAULT 1 COMMENT '是否有效(0-无效 1-有效)',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uk_jti`(`jti` ASC) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '系统模块-License 授权表'