Files
Codex 04bac15e59 Snapshot friend_back worktree for local merge
Source HEAD: 9d7e220f14
Includes uncommitted project changes and new project files.
Align shared text line endings and executable flags with Friendship-and-chat-api.
Normalize new text to LF; exclude .workbuddy local assistant memory.
Original friend_back checkout is unchanged.
2026-10-29 16:30:16 +08:00

18 lines
1.2 KiB
SQL
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.
-- 子账号管理:holder 与 子账号/专属角色 的绑定关系
-- 执行位置:chat_v1 库
CREATE TABLE IF NOT EXISTS `system_sub_account` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`holder_user_id` bigint NOT NULL COMMENT '管理者用户编号(system_users.id)',
`sub_user_id` bigint NOT NULL COMMENT '子账号用户编号(system_users.id)',
`role_id` bigint NOT NULL COMMENT '子账号专属角色编号(system_role.id)',
`creator` varchar(64) NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(64) NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号',
PRIMARY KEY (`id`),
KEY `idx_holder_user_id` (`holder_user_id`),
KEY `idx_sub_user_id` (`sub_user_id`)
) ENGINE = InnoDB COMMENT '后台子账号表';