Files
ai-crm/apps/server/sql/design/sys/sys_license_design.sql
T
2026-10-21 23:23:48 +08:00

26 lines
1.8 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.
-- ========================================
-- 系统-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 授权表'