This page lists files in the current directory. You can view content, get download/execute commands for Wget, Curl, or PowerShell, or filter the list using wildcards (e.g., `*.sh`).
wget 'https://sme10.lists2.roe3.org/kodbox/app/controller/install/data/fulltext.sql'
-- 移除旧的索引(不存在报错正常)
-- ALTER TABLE `user` DROP INDEX `name`;
-- ALTER TABLE `user` DROP INDEX `nickName`;
-- ALTER TABLE `user_meta` DROP INDEX `value`;
-- ALTER TABLE `group` DROP INDEX `name`;
-- ALTER TABLE `group_meta` DROP INDEX `value`;
ALTER TABLE `comment` DROP INDEX `content`;
ALTER TABLE `io_source` DROP INDEX `name`;
ALTER TABLE `io_source_meta` DROP INDEX `value`;
ALTER TABLE `io_file_contents` DROP INDEX `content`;
-- 创建全文索引
-- ALTER TABLE `user` ADD FULLTEXT(`name`) with parser ngram;
-- ALTER TABLE `user` ADD FULLTEXT(`nickName`) with parser ngram;
-- ALTER TABLE `user_meta` ADD FULLTEXT(`value`) with parser ngram;
-- ALTER TABLE `group` ADD FULLTEXT(`name`) with parser ngram;
-- ALTER TABLE `group_meta` ADD FULLTEXT(`value`) with parser ngram;
ALTER TABLE `comment` ADD FULLTEXT(`content`) with parser ngram;
ALTER TABLE `io_source` ADD FULLTEXT(`name`) with parser ngram;
ALTER TABLE `io_source_meta` ADD FULLTEXT(`value`) with parser ngram;
ALTER TABLE `io_file_contents` ADD FULLTEXT(`content`) with parser ngram;
wget 'https://sme10.lists2.roe3.org/kodbox/app/controller/install/data/help.md'
# kodbox表结构数据字典
[TOC]
### comment 通用评论表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| commentID | bigint(20) unsigned `自动增量` | 评论id |
| pid | bigint(20) unsigned | 该评论上级ID |
| userID | bigint(20) unsigned | 评论用户id |
| targetType | int(10) unsigned | 评论对象类型1分享2文件3文章4...... |
| targetID | bigint(20) unsigned | 评论对象id |
| content | mediumtext | 评论内容 |
| praiseCount | int(11) unsigned | 点赞统计 |
| commentCount | int(11) unsigned | 评论统计 |
| status | tinyint(3) unsigned | 状态 1正常 2异常 3其他 |
| modifyTime | int(11) unsigned | 最后修改时间 |
| createTime | int(11) unsigned | 创建时间 |
### comment_meta 评论表扩展字段
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` |
| commentID | bigint(20) unsigned | 评论id |
| key | varchar(255) | 字段key |
| value | text | 字段值 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改 |
### comment_praise 评论点赞表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | ID |
| commentID | bigint(20) unsigned | 评论ID |
| userID | int(11) unsigned | 用户ID |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 修改时间 |
### group 群组表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| groupID | bigint(20) unsigned `自动增量` | 群组id |
| name | varchar(255) | 群组名 |
| parentID | bigint(20) unsigned | 父群组id |
| parentLevel | varchar(1000) | 父路径id; 例如: ,2,5,10 |
| extraField | varchar(100) 默认值=NULL | 扩展字段 |
| sort | int(11) unsigned | 排序 |
| sizeMax | double unsigned | 群组存储空间大小(GB) 0-不限制 |
| sizeUse | bigint(20) unsigned | 已使用大小(byte) |
| modifyTime | int(11) unsigned | 最后修改时间 |
| createTime | int(11) unsigned | 创建时间 |
### group_meta 用户数据扩展表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| groupID | bigint(20) unsigned | 部门id |
| key | varchar(255) | 存储key |
| value | text | 对应值 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### io_file 文档存储表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| fileID | bigint(20) unsigned `自动增量` | 自增id |
| name | varchar(255) | 文件名 |
| size | bigint(20) unsigned | 文件大小 |
| ioType | int(10) unsigned | io的id |
| path | varchar(255) | 文件路径 |
| hashSimple | varchar(100) | 文件简易hash(不全覆盖);hashSimple |
| hashMd5 | varchar(100) | 文件hash, md5 |
| linkCount | int(11) unsigned | 引用次数;0则定期删除 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### io_file_contents 文件id
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| fileID | bigint(20) unsigned `自动增量` | 文件ID |
| content | mediumtext | 文本文件内容,最大16M |
| createTime | int(11) unsigned | 创建时间 |
### io_file_meta 文件扩展表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| fileID | bigint(20) unsigned | 文件id |
| key | varchar(255) | 存储key |
| value | text | 对应值 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### io_source 文档数据表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| sourceID | bigint(20) unsigned `自动增量` |
| sourceHash | varchar(20) | id的hash |
| targetType | tinyint(3) unsigned | 文档所属类型 (0-sys,1-user,2-group) |
| targetID | bigint(20) unsigned | 拥有者对象id |
| createUser | bigint(20) unsigned | 创建者id |
| modifyUser | bigint(20) unsigned | 最后修改者 |
| isFolder | tinyint(4) unsigned | 是否为文件夹(0否,1是) |
| name | varchar(250) | 文件名 |
| fileType | varchar(10) | 文件扩展名,文件夹则为空 |
| parentID | bigint(20) unsigned | 父级资源id,为0则为部门或用户根文件夹,添加用户部门时自动新建 |
| parentLevel | varchar(2000) | 父路径id; 例如: ,2,5,10 |
| fileID | bigint(20) unsigned | 对应存储资源id,文件夹则该处为0 |
| isDelete | tinyint(4) unsigned | 是否删除(0-正常 1-已删除) |
| size | bigint(20) unsigned | 占用空间大小 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
| viewTime | int(11) unsigned | 最后访问时间 |
### io_source_auth 文档权限表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | int(11) unsigned `自动增量` | 自增id |
| sourceID | bigint(20) unsigned | 文档资源id |
| targetType | tinyint(4) unsigned | 分享给的对象,1用户,2部门 |
| targetID | bigint(20) unsigned | 所属对象id |
| authID | int(11) unsigned | 权限组id;自定义权限则为0 |
| authDefine | int(11) | 自定义权限,4字节占位 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### io_source_event 文档事件表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| sourceID | bigint(20) unsigned | 文档id |
| sourceParent | bigint(20) unsigned | 文档父文件夹id |
| userID | bigint(20) unsigned | 操作者id |
| type | varchar(255) | 事件类型 |
| desc | text | 数据详情,根据type内容意义不同 |
| createTime | int(11) unsigned | 创建时间 |
### io_source_history 文档历史记录表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| sourceID | bigint(20) unsigned | 文档资源id |
| userID | bigint(20) unsigned | 用户id, 对部门时此id为0 |
| fileID | bigint(20) unsigned | 当前版本对应存储资源id |
| size | bigint(20) | 文件大小 |
| detail | varchar(1024) | 版本描述 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### io_source_meta 文档扩展表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| sourceID | bigint(20) unsigned | 文档id |
| key | varchar(255) | 存储key |
| value | text | 对应值 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### io_source_recycle 文档回收站
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| targetType | tinyint(3) unsigned | 文档所属类型 (0-sys,1-user,2-group) |
| targetID | bigint(20) unsigned | 拥有者对象id |
| sourceID | bigint(20) unsigned | 文档id |
| userID | bigint(20) unsigned | 操作者id |
| parentLevel | varchar(2000) | 文档上层关系;冗余字段,便于统计回收站信息 |
| createTime | int(11) unsigned | 创建时间 |
### share 分享数据表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| shareID | bigint(20) unsigned `自动增量` | 自增id |
| title | varchar(255) | 分享标题 |
| shareHash | varchar(50) | shareid |
| userID | bigint(20) unsigned | 分享用户id |
| sourceID | bigint(20) | 用户数据id |
| sourcePath | varchar(1024) | 分享文档路径 |
| url | varchar(255) | 分享别名,替代shareHash |
| isLink | tinyint(4) unsigned | 是否外链分享;默认为0 |
| isShareTo | tinyint(4) unsigned | 是否为内部分享;默认为0 |
| password | varchar(255) | 访问密码,为空则无密码 |
| timeTo | int(11) unsigned | 到期时间,0-永久生效 |
| numView | bigint(20) unsigned | 预览次数 |
| numDownload | bigint(20) unsigned | 下载次数 |
| options | text | json 配置信息 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### share_report 分享举报表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| shareID | bigint(20) unsigned | 分享id |
| title | varchar(255) | 分享标题 |
| sourceID | bigint(20) unsigned | 举报资源id |
| fileID | bigint(20) unsigned | 举报文件id,文件夹则该处为0 |
| userID | bigint(20) unsigned | 举报用户id |
| type | tinyint(3) unsigned | 举报类型 (1-侵权,2-色情,3-暴力,4-政治,5-其他) |
| desc | text | 举报原因(其他)描述 |
| status | tinyint(3) unsigned | 处理状态(0-未处理,1-已处理,2-禁止分享) |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### share_to 分享给指定用户(协作)
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| shareID | bigint(20) unsigned | 分享id |
| targetType | tinyint(4) unsigned | 分享给的对象,1用户,2部门 |
| targetID | bigint(20) unsigned | 所属对象id |
| authID | int(11) unsigned | 权限组id;自定义权限则为0 |
| authDefine | int(11) | 自定义权限,4字节占位 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### system_log 系统日志表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` |
| sessionID | varchar(128) | session识别码,用于登陆时记录ip,UA等信息 |
| userID | bigint(20) unsigned | 用户id |
| type | varchar(255) | 日志类型 |
| desc | text | 详情 |
| createTime | int(11) unsigned | 创建时间 |
### system_option 系统配置表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` |
| type | varchar(50) | 配置类型 |
| key | varchar(255) |
| value | text |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后更新时间 |
### system_session session
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` |
| sign | varchar(128) | session标识 |
| userID | bigint(20) unsigned | 用户id |
| content | text | value |
| expires | int(10) unsigned | 过期时间 |
| modifyTime | int(10) unsigned | 修改时间 |
| createTime | int(10) unsigned | 创建时间 |
### user 用户表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| userID | bigint(20) unsigned `自动增量` | 自增id |
| name | varchar(255) | 登陆用户名 |
| roleID | int(11) unsigned | 用户角色 |
| email | varchar(255) | 邮箱 |
| phone | varchar(20) | 手机 |
| nickName | varchar(255) | 昵称 |
| avatar | varchar(255) | 头像 |
| sex | tinyint(4) unsigned | 性别 (0女1男) |
| password | varchar(100) | 密码 |
| sizeMax | bigint(20) unsigned | 群组存储空间大小(GB) 0-不限制 |
| sizeUse | bigint(20) unsigned | 已使用大小(byte) |
| status | tinyint(3) unsigned | 用户启用状态 0-未启用 1-启用 |
| lastLogin | int(11) unsigned | 最后登陆时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
| createTime | int(11) unsigned | 创建时间 |
### user_fav 用户文档标签表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` |
| userID | bigint(20) unsigned | 用户id |
| tagID | int(11) unsigned | 标签id,收藏则为0 |
| name | varchar(255) | 收藏名称 |
| path | varchar(2048) | 收藏路径,tag时则为sourceID |
| type | varchar(20) | source/path |
| sort | int(11) unsigned | 排序 |
| modifyTime | int(11) unsigned | 最后修改时间 |
| createTime | int(11) unsigned | 创建时间 |
### user_group 用户群组关联表(一对多)
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` |
| userID | bigint(20) unsigned | 用户id |
| groupID | bigint(20) unsigned | 群组id |
| authID | int(11) unsigned | 在群组内的权限 |
| sort | int(11) unsigned | 在该群组的排序 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### user_meta 用户数据扩展表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| userID | bigint(20) unsigned | 用户id |
| key | varchar(255) | 存储key |
| value | text | 对应值 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
### user_option 用户数据配置表
| 字段 | 类型 | 字段说明 |
| ---- | ---- | ---- |
| id | bigint(20) unsigned `自动增量` | 自增id |
| userID | bigint(20) unsigned | 用户id |
| type | varchar(50) | 配置类型,全局配置类型为空,编辑器配置type=editor |
| key | varchar(255) | 配置key |
| value | text | 配置值 |
| createTime | int(11) unsigned | 创建时间 |
| modifyTime | int(11) unsigned | 最后修改时间 |
wget 'https://sme10.lists2.roe3.org/kodbox/app/controller/install/data/mysql.sql'
-- dump by kodbox
SET NAMES utf8;
DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
`commentID` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '评论id',
`pid` bigint(20) unsigned NOT NULL COMMENT '该评论上级ID',
`userID` bigint(20) unsigned NOT NULL COMMENT '评论用户id',
`targetType` int(10) unsigned NOT NULL COMMENT '评论对象类型1分享2文件3文章4......',
`targetID` bigint(20) unsigned NOT NULL COMMENT '评论对象id',
`content` mediumtext NOT NULL COMMENT '评论内容',
`praiseCount` int(11) unsigned NOT NULL COMMENT '点赞统计',
`commentCount` int(11) unsigned NOT NULL COMMENT '评论统计',
`status` tinyint(3) unsigned NOT NULL COMMENT '状态 1正常 2异常 3其他',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`commentID`),
KEY `pid` (`pid`),
KEY `userID` (`userID`),
KEY `targetType` (`targetType`),
KEY `targetID` (`targetID`),
KEY `praiseCount` (`praiseCount`),
KEY `commentCount` (`commentCount`),
KEY `modifyTime` (`modifyTime`),
KEY `createTime` (`createTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='通用评论表';
DROP TABLE IF EXISTS `comment_meta`;
CREATE TABLE `comment_meta` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`commentID` bigint(20) unsigned NOT NULL COMMENT '评论id',
`key` varchar(255) NOT NULL COMMENT '字段key',
`value` text NOT NULL COMMENT '字段值',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改',
PRIMARY KEY (`id`),
UNIQUE KEY `commentID_key` (`commentID`,`key`(200)),
KEY `commentID` (`commentID`),
KEY `key` (`key`(200))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='评论表扩展字段';
DROP TABLE IF EXISTS `comment_praise`;
CREATE TABLE `comment_praise` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`commentID` bigint(20) unsigned NOT NULL COMMENT '评论ID',
`userID` int(11) unsigned NOT NULL COMMENT '用户ID',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `commentID_userID` (`commentID`,`userID`),
KEY `commentID` (`commentID`),
KEY `userID` (`userID`),
KEY `modifyTime` (`modifyTime`),
KEY `createTime` (`createTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='评论点赞表';
DROP TABLE IF EXISTS `group`;
CREATE TABLE `group` (
`groupID` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '群组id',
`name` varchar(255) NOT NULL COMMENT '群组名',
`parentID` bigint(20) unsigned NOT NULL COMMENT '父群组id',
`parentLevel` varchar(1000) NOT NULL COMMENT '父路径id; 例如: ,2,5,10,',
`extraField` varchar(100) DEFAULT NULL COMMENT '扩展字段',
`sort` int(11) unsigned NOT NULL COMMENT '排序',
`sizeMax` double unsigned NOT NULL COMMENT '群组存储空间大小(GB) 0-不限制',
`sizeUse` bigint(20) unsigned NOT NULL COMMENT '已使用大小(byte)',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`groupID`),
KEY `parentID` (`parentID`),
KEY `createTime` (`createTime`),
KEY `modifyTime` (`modifyTime`),
KEY `order` (`sort`),
KEY `parentLevel` (`parentLevel`(250)),
KEY `name` (`name`(200))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='群组表';
DROP TABLE IF EXISTS `group_meta`;
CREATE TABLE `group_meta` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`groupID` bigint(20) unsigned NOT NULL COMMENT '部门id',
`key` varchar(255) NOT NULL COMMENT '存储key',
`value` text NOT NULL COMMENT '对应值',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `groupID_key` (`groupID`,`key`(200)),
KEY `groupID` (`groupID`),
KEY `key` (`key`(200))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户数据扩展表';
DROP TABLE IF EXISTS `io_file`;
CREATE TABLE `io_file` (
`fileID` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`name` varchar(255) NOT NULL COMMENT '文件名',
`size` bigint(20) unsigned NOT NULL COMMENT '文件大小',
`ioType` int(10) unsigned NOT NULL COMMENT 'io的id',
`path` varchar(255) NOT NULL COMMENT '文件路径',
`hashSimple` varchar(100) NOT NULL COMMENT '文件简易hash(不全覆盖);hashSimple',
`hashMd5` varchar(100) NOT NULL COMMENT '文件hash, md5',
`linkCount` int(11) unsigned NOT NULL COMMENT '引用次数;0则定期删除',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`fileID`),
KEY `size` (`size`),
KEY `linkCount` (`linkCount`),
KEY `createTime` (`createTime`),
KEY `ioType` (`ioType`),
KEY `path` (`path`(200)),
KEY `name` (`name`(200)),
KEY `hash` (`hashSimple`),
KEY `hashMd5` (`hashMd5`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文档存储表';
DROP TABLE IF EXISTS `io_file_contents`;
CREATE TABLE `io_file_contents` (
`fileID` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '文件ID',
`content` mediumtext NOT NULL COMMENT '文本文件内容,最大16M',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`fileID`),
KEY `createTime` (`createTime`),
KEY `content` (`content`(250))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文件id';
DROP TABLE IF EXISTS `io_file_meta`;
CREATE TABLE `io_file_meta` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`fileID` bigint(20) unsigned NOT NULL COMMENT '文件id',
`key` varchar(255) NOT NULL COMMENT '存储key',
`value` text NOT NULL COMMENT '对应值',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `fileID_key` (`fileID`,`key`(200)),
KEY `fileID` (`fileID`),
KEY `key` (`key`(200))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文件扩展表';
DROP TABLE IF EXISTS `io_source`;
CREATE TABLE `io_source` (
`sourceID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`sourceHash` varchar(20) NOT NULL COMMENT ' id的hash',
`targetType` tinyint(3) unsigned NOT NULL COMMENT '文档所属类型 (0-sys,1-user,2-group)',
`targetID` bigint(20) unsigned NOT NULL COMMENT '拥有者对象id',
`createUser` bigint(20) unsigned NOT NULL COMMENT '创建者id',
`modifyUser` bigint(20) unsigned NOT NULL COMMENT '最后修改者',
`isFolder` tinyint(4) unsigned NOT NULL COMMENT '是否为文件夹(0否,1是)',
`name` varchar(250) NOT NULL COMMENT '文件名',
`fileType` varchar(10) NOT NULL COMMENT '文件扩展名,文件夹则为空',
`parentID` bigint(20) unsigned NOT NULL COMMENT '父级资源id,为0则为部门或用户根文件夹,添加用户部门时自动新建',
`parentLevel` varchar(2000) NOT NULL COMMENT '父路径id; 例如: ,2,5,10,',
`fileID` bigint(20) unsigned NOT NULL COMMENT '对应存储资源id,文件夹则该处为0',
`isDelete` tinyint(4) unsigned NOT NULL COMMENT '是否删除(0-正常 1-已删除)',
`size` bigint(20) unsigned NOT NULL COMMENT '占用空间大小',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
`viewTime` int(11) unsigned NOT NULL COMMENT '最后访问时间',
PRIMARY KEY (`sourceID`),
KEY `targetType` (`targetType`),
KEY `targetID` (`targetID`),
KEY `createUser` (`createUser`),
KEY `isFolder` (`isFolder`),
KEY `parentID` (`parentID`),
KEY `parentLevel` (`parentLevel`(250)),
KEY `fileID` (`fileID`),
KEY `isDelete` (`isDelete`),
KEY `size` (`size`),
KEY `modifyTime` (`modifyTime`),
KEY `createTime` (`createTime`),
KEY `viewTime` (`viewTime`),
KEY `modifyUser` (`modifyUser`),
KEY `targetType_targetID_parentID` (`targetType`,`targetID`,`parentID`),
KEY `parentID_isDelete` (`parentID`,`isDelete`),
KEY `name` (`name`(200)),
KEY `fileType` (`fileType`),
KEY `parentID_name` (`parentID`,`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文档数据表';
DROP TABLE IF EXISTS `io_source_auth`;
CREATE TABLE `io_source_auth` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`sourceID` bigint(20) unsigned NOT NULL COMMENT '文档资源id',
`targetType` tinyint(4) unsigned NOT NULL COMMENT '分享给的对象,1用户,2部门',
`targetID` bigint(20) unsigned NOT NULL COMMENT '所属对象id',
`authID` int(11) unsigned NOT NULL COMMENT '权限组id;自定义权限则为0',
`authDefine` int(11) NOT NULL COMMENT '自定义权限,4字节占位',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
KEY `sourceID` (`sourceID`),
KEY `userID` (`targetType`),
KEY `groupID` (`targetID`),
KEY `auth` (`authID`),
KEY `authDefine` (`authDefine`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文档权限表';
DROP TABLE IF EXISTS `io_source_event`;
CREATE TABLE `io_source_event` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`sourceID` bigint(20) unsigned NOT NULL COMMENT '文档id',
`sourceParent` bigint(20) unsigned NOT NULL COMMENT '文档父文件夹id',
`userID` bigint(20) unsigned NOT NULL COMMENT '操作者id',
`type` varchar(255) NOT NULL COMMENT '事件类型',
`desc` text NOT NULL COMMENT '数据详情,根据type内容意义不同',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `sourceID` (`sourceID`),
KEY `sourceParent` (`sourceParent`),
KEY `userID` (`userID`),
KEY `eventType` (`type`),
KEY `createTime` (`createTime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='文档事件表';
DROP TABLE IF EXISTS `io_source_history`;
CREATE TABLE `io_source_history` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`sourceID` bigint(20) unsigned NOT NULL COMMENT '文档资源id',
`userID` bigint(20) unsigned NOT NULL COMMENT '用户id, 对部门时此id为0',
`fileID` bigint(20) unsigned NOT NULL COMMENT '当前版本对应存储资源id',
`size` bigint(20) NOT NULL COMMENT '文件大小',
`detail` varchar(1024) NOT NULL COMMENT '版本描述',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
KEY `sourceID` (`sourceID`),
KEY `userID` (`userID`),
KEY `fileID` (`fileID`),
KEY `createTime` (`createTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文档历史记录表';
DROP TABLE IF EXISTS `io_source_meta`;
CREATE TABLE `io_source_meta` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`sourceID` bigint(20) unsigned NOT NULL COMMENT '文档id',
`key` varchar(255) NOT NULL COMMENT '存储key',
`value` text NOT NULL COMMENT '对应值',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `sourceID_key` (`sourceID`,`key`(200)),
KEY `sourceID` (`sourceID`),
KEY `key` (`key`(200))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文档扩展表';
DROP TABLE IF EXISTS `io_source_recycle`;
CREATE TABLE `io_source_recycle` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`targetType` tinyint(3) unsigned NOT NULL COMMENT '文档所属类型 (0-sys,1-user,2-group)',
`targetID` bigint(20) unsigned NOT NULL COMMENT '拥有者对象id',
`sourceID` bigint(20) unsigned NOT NULL COMMENT '文档id',
`userID` bigint(20) unsigned NOT NULL COMMENT '操作者id',
`parentLevel` varchar(2000) NOT NULL COMMENT '文档上层关系;冗余字段,便于统计回收站信息',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `sourceID` (`sourceID`),
KEY `userID` (`userID`),
KEY `createTime` (`createTime`),
KEY `parentLevel` (`parentLevel`(250)),
KEY `targetType` (`targetType`),
KEY `targetID` (`targetID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='文档回收站';
DROP TABLE IF EXISTS `share`;
CREATE TABLE `share` (
`shareID` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`title` varchar(255) NOT NULL COMMENT '分享标题',
`shareHash` varchar(50) NOT NULL COMMENT 'shareid',
`userID` bigint(20) unsigned NOT NULL COMMENT '分享用户id',
`sourceID` bigint(20) NOT NULL COMMENT '用户数据id',
`sourcePath` varchar(1024) NOT NULL COMMENT '分享文档路径',
`url` varchar(255) NOT NULL COMMENT '分享别名,替代shareHash',
`isLink` tinyint(4) unsigned NOT NULL COMMENT '是否外链分享;默认为0',
`isShareTo` tinyint(4) unsigned NOT NULL COMMENT '是否为内部分享;默认为0',
`password` varchar(255) NOT NULL COMMENT '访问密码,为空则无密码',
`timeTo` int(11) unsigned NOT NULL COMMENT '到期时间,0-永久生效',
`numView` bigint(20) unsigned NOT NULL COMMENT '预览次数',
`numDownload` bigint(20) unsigned NOT NULL COMMENT '下载次数',
`options` text COMMENT 'json 配置信息 ',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`shareID`),
KEY `userID` (`userID`),
KEY `createTime` (`createTime`),
KEY `modifyTime` (`modifyTime`),
KEY `path` (`sourceID`),
KEY `sid` (`shareHash`),
KEY `public` (`isLink`),
KEY `timeTo` (`timeTo`),
KEY `numView` (`numView`),
KEY `numDownload` (`numDownload`),
KEY `isShareTo` (`isShareTo`),
KEY `url` (`url`(250))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='分享数据表';
DROP TABLE IF EXISTS `share_report`;
CREATE TABLE `share_report` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`shareID` bigint(20) unsigned NOT NULL COMMENT '分享id',
`title` varchar(255) NOT NULL COMMENT '分享标题',
`sourceID` bigint(20) unsigned NOT NULL COMMENT '举报资源id',
`fileID` bigint(20) unsigned NOT NULL COMMENT '举报文件id,文件夹则该处为0',
`userID` bigint(20) unsigned NOT NULL COMMENT '举报用户id',
`type` tinyint(3) unsigned NOT NULL COMMENT '举报类型 (1-侵权,2-色情,3-暴力,4-政治,5-其他)',
`desc` text NOT NULL COMMENT '举报原因(其他)描述',
`status` tinyint(3) unsigned NOT NULL COMMENT '处理状态(0-未处理,1-已处理,2-禁止分享)',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
KEY `shareID` (`shareID`),
KEY `sourceID` (`sourceID`),
KEY `fileID` (`fileID`),
KEY `userID` (`userID`),
KEY `type` (`type`),
KEY `modifyTime` (`modifyTime`),
KEY `createTime` (`createTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='分享举报表';
DROP TABLE IF EXISTS `share_to`;
CREATE TABLE `share_to` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`shareID` bigint(20) unsigned NOT NULL COMMENT '分享id',
`targetType` tinyint(4) unsigned NOT NULL COMMENT '分享给的对象,1用户,2部门',
`targetID` bigint(20) unsigned NOT NULL COMMENT '所属对象id',
`authID` int(11) unsigned NOT NULL COMMENT '权限组id;自定义权限则为0',
`authDefine` int(11) NOT NULL COMMENT '自定义权限,4字节占位',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
KEY `shareID` (`shareID`),
KEY `userID` (`targetType`),
KEY `targetID` (`targetID`),
KEY `authDefine` (`authDefine`),
KEY `authID` (`authID`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='分享给指定用户(协作)';
DROP TABLE IF EXISTS `system_log`;
CREATE TABLE `system_log` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`sessionID` varchar(128) NOT NULL COMMENT 'session识别码,用于登陆时记录ip,UA等信息',
`userID` bigint(20) unsigned NOT NULL COMMENT '用户id',
`type` varchar(255) NOT NULL COMMENT '日志类型',
`desc` text NOT NULL COMMENT '详情',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `userID` (`userID`),
KEY `type` (`type`),
KEY `createTime` (`createTime`),
KEY `sessionID` (`sessionID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统日志表';
DROP TABLE IF EXISTS `system_option`;
CREATE TABLE `system_option` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(50) NOT NULL COMMENT '配置类型',
`key` varchar(255) NOT NULL,
`value` text NOT NULL,
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `key_type` (`key`(200),`type`),
KEY `createTime` (`createTime`),
KEY `modifyTime` (`modifyTime`),
KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='系统配置表';
DROP TABLE IF EXISTS `system_session`;
CREATE TABLE `system_session` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`sign` varchar(128) NOT NULL COMMENT 'session标识',
`userID` bigint(20) unsigned NOT NULL COMMENT '用户id',
`content` text NOT NULL COMMENT 'value',
`expires` int(10) unsigned NOT NULL COMMENT '过期时间',
`modifyTime` int(10) unsigned NOT NULL COMMENT '修改时间',
`createTime` int(10) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `sign` (`sign`),
KEY `userID` (`userID`),
KEY `expires` (`expires`),
KEY `modifyTime` (`modifyTime`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='session';
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`userID` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`name` varchar(255) NOT NULL COMMENT '登陆用户名',
`roleID` int(11) unsigned NOT NULL COMMENT '用户角色',
`email` varchar(255) NOT NULL COMMENT '邮箱',
`phone` varchar(20) NOT NULL COMMENT '手机',
`nickName` varchar(255) NOT NULL COMMENT '昵称',
`avatar` varchar(255) NOT NULL COMMENT '头像',
`sex` tinyint(4) unsigned NOT NULL COMMENT '性别 (0女1男)',
`password` varchar(100) NOT NULL COMMENT '密码',
`sizeMax` bigint(20) unsigned NOT NULL COMMENT '群组存储空间大小(GB) 0-不限制',
`sizeUse` bigint(20) unsigned NOT NULL COMMENT '已使用大小(byte)',
`status` tinyint(3) unsigned NOT NULL COMMENT '用户启用状态 0-未启用 1-启用',
`lastLogin` int(11) unsigned NOT NULL COMMENT '最后登陆时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`userID`),
KEY `name` (`name`(250)),
KEY `email` (`email`(250)),
KEY `status` (`status`),
KEY `modifyTime` (`modifyTime`),
KEY `lastLogin` (`lastLogin`),
KEY `createTime` (`createTime`),
KEY `nickName` (`nickName`(250)),
KEY `phone` (`phone`),
KEY `sizeUse` (`sizeUse`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户表';
DROP TABLE IF EXISTS `user_fav`;
CREATE TABLE `user_fav` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`userID` bigint(20) unsigned NOT NULL COMMENT '用户id',
`tagID` int(11) unsigned NOT NULL COMMENT '标签id,收藏则为0',
`name` varchar(255) NOT NULL COMMENT '收藏名称',
`path` varchar(2048) NOT NULL COMMENT '收藏路径,tag时则为sourceID',
`type` varchar(20) NOT NULL COMMENT 'source/path',
`sort` int(11) unsigned NOT NULL COMMENT '排序',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `createTime` (`createTime`),
KEY `userID` (`userID`),
KEY `name` (`name`(250)),
KEY `sort` (`sort`),
KEY `tagID` (`tagID`),
KEY `path` (`path`(250)),
KEY `type` (`type`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户文档标签表';
DROP TABLE IF EXISTS `user_group`;
CREATE TABLE `user_group` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`userID` bigint(20) unsigned NOT NULL COMMENT '用户id',
`groupID` bigint(20) unsigned NOT NULL COMMENT '群组id',
`authID` int(11) unsigned NOT NULL COMMENT '在群组内的权限',
`sort` int(11) unsigned NOT NULL COMMENT '在该群组的排序',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `userID_groupID` (`userID`,`groupID`),
KEY `userID` (`userID`),
KEY `groupID` (`groupID`),
KEY `groupRole` (`authID`),
KEY `sort` (`sort`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户群组关联表(一对多)';
DROP TABLE IF EXISTS `user_meta`;
CREATE TABLE `user_meta` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`userID` bigint(20) unsigned NOT NULL COMMENT '用户id',
`key` varchar(255) NOT NULL COMMENT '存储key',
`value` text NOT NULL COMMENT '对应值',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `userID_metaKey` (`userID`,`key`(200)),
KEY `userID` (`userID`),
KEY `metaKey` (`key`(200))
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户数据扩展表';
DROP TABLE IF EXISTS `user_option`;
CREATE TABLE `user_option` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
`userID` bigint(20) unsigned NOT NULL COMMENT '用户id',
`type` varchar(50) NOT NULL COMMENT '配置类型,全局配置类型为空,编辑器配置type=editor',
`key` varchar(255) NOT NULL COMMENT '配置key',
`value` text NOT NULL COMMENT '配置值',
`createTime` int(11) unsigned NOT NULL COMMENT '创建时间',
`modifyTime` int(11) unsigned NOT NULL COMMENT '最后修改时间',
PRIMARY KEY (`id`),
UNIQUE KEY `userID_key_type` (`userID`,`key`(200),`type`),
KEY `userID` (`userID`),
KEY `type` (`type`),
KEY `key` (`key`(200))
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户数据配置表';
wget 'https://sme10.lists2.roe3.org/kodbox/app/controller/install/data/sqlite.sql'
DROP TABLE IF EXISTS '______';
CREATE TABLE '______'('<?php exit;?>>' integer);
CREATE INDEX 'idx_aa_______' ON '______' ('<?php exit;?>>');
-- dump by kodbox
DROP TABLE IF EXISTS "comment";
CREATE TABLE "comment" (
"commentID" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"pid" integer NOT NULL,
"userID" integer NOT NULL,
"targetType" integer NOT NULL,
"targetID" integer NOT NULL,
"content" mediumtext NOT NULL,
"praiseCount" integer NOT NULL,
"commentCount" integer NOT NULL,
"status" smallint NOT NULL,
"modifyTime" integer NOT NULL,
"createTime" integer NOT NULL
);
-- index comment:
CREATE INDEX 'idx_comment_primary_key' ON 'comment' ("commentID");
CREATE INDEX 'idx_comment_pid' ON 'comment' ("pid");
CREATE INDEX 'idx_comment_userID' ON 'comment' ("userID");
CREATE INDEX 'idx_comment_targetType' ON 'comment' ("targetType");
CREATE INDEX 'idx_comment_targetID' ON 'comment' ("targetID");
CREATE INDEX 'idx_comment_praiseCount' ON 'comment' ("praiseCount");
CREATE INDEX 'idx_comment_commentCount' ON 'comment' ("commentCount");
CREATE INDEX 'idx_comment_modifyTime' ON 'comment' ("modifyTime");
CREATE INDEX 'idx_comment_createTime' ON 'comment' ("createTime");
DROP TABLE IF EXISTS "comment_meta";
CREATE TABLE "comment_meta" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"commentID" integer NOT NULL,
"key" varchar(255) NOT NULL,
"value" text NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index comment_meta:
CREATE INDEX 'idx_comment_meta_primary_key' ON 'comment_meta' ("id");
CREATE UNIQUE INDEX 'idx_comment_meta_commentID_key' ON 'comment_meta' ("commentID","key");
CREATE INDEX 'idx_comment_meta_commentID' ON 'comment_meta' ("commentID");
CREATE INDEX 'idx_comment_meta_key' ON 'comment_meta' ("key");
DROP TABLE IF EXISTS "comment_praise";
CREATE TABLE "comment_praise" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"commentID" integer NOT NULL,
"userID" integer NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index comment_praise:
CREATE INDEX 'idx_comment_praise_primary_key' ON 'comment_praise' ("id");
CREATE UNIQUE INDEX 'idx_comment_praise_commentID_userID' ON 'comment_praise' ("commentID","userID");
CREATE INDEX 'idx_comment_praise_commentID' ON 'comment_praise' ("commentID");
CREATE INDEX 'idx_comment_praise_userID' ON 'comment_praise' ("userID");
CREATE INDEX 'idx_comment_praise_modifyTime' ON 'comment_praise' ("modifyTime");
CREATE INDEX 'idx_comment_praise_createTime' ON 'comment_praise' ("createTime");
DROP TABLE IF EXISTS "group";
CREATE TABLE "group" (
"groupID" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" varchar(255) NOT NULL,
"parentID" integer NOT NULL,
"parentLevel" varchar(1000) NOT NULL,
"extraField" varchar(100) DEFAULT NULL,
"sort" integer NOT NULL,
"sizeMax" double unsigned NOT NULL,
"sizeUse" integer NOT NULL,
"modifyTime" integer NOT NULL,
"createTime" integer NOT NULL
);
-- index group:
CREATE INDEX 'idx_group_primary_key' ON 'group' ("groupID");
CREATE INDEX 'idx_group_parentID' ON 'group' ("parentID");
CREATE INDEX 'idx_group_createTime' ON 'group' ("createTime");
CREATE INDEX 'idx_group_modifyTime' ON 'group' ("modifyTime");
CREATE INDEX 'idx_group_order' ON 'group' ("sort");
CREATE INDEX 'idx_group_parentLevel' ON 'group' ("parentLevel");
CREATE INDEX 'idx_group_name' ON 'group' ("name");
DROP TABLE IF EXISTS "group_meta";
CREATE TABLE "group_meta" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"groupID" integer NOT NULL,
"key" varchar(255) NOT NULL,
"value" text NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index group_meta:
CREATE INDEX 'idx_group_meta_primary_key' ON 'group_meta' ("id");
CREATE UNIQUE INDEX 'idx_group_meta_groupID_key' ON 'group_meta' ("groupID","key");
CREATE INDEX 'idx_group_meta_groupID' ON 'group_meta' ("groupID");
CREATE INDEX 'idx_group_meta_key' ON 'group_meta' ("key");
DROP TABLE IF EXISTS "io_file";
CREATE TABLE "io_file" (
"fileID" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" varchar(255) NOT NULL,
"size" integer NOT NULL,
"ioType" integer NOT NULL,
"path" varchar(255) NOT NULL,
"hashSimple" varchar(100) NOT NULL,
"hashMd5" varchar(100) NOT NULL,
"linkCount" integer NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index io_file:
CREATE INDEX 'idx_io_file_primary_key' ON 'io_file' ("fileID");
CREATE INDEX 'idx_io_file_size' ON 'io_file' ("size");
CREATE INDEX 'idx_io_file_linkCount' ON 'io_file' ("linkCount");
CREATE INDEX 'idx_io_file_createTime' ON 'io_file' ("createTime");
CREATE INDEX 'idx_io_file_ioType' ON 'io_file' ("ioType");
CREATE INDEX 'idx_io_file_path' ON 'io_file' ("path");
CREATE INDEX 'idx_io_file_name' ON 'io_file' ("name");
CREATE INDEX 'idx_io_file_hash' ON 'io_file' ("hashSimple");
CREATE INDEX 'idx_io_file_hashMd5' ON 'io_file' ("hashMd5");
DROP TABLE IF EXISTS "io_file_contents";
CREATE TABLE "io_file_contents" (
"fileID" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"content" mediumtext NOT NULL,
"createTime" integer NOT NULL
);
-- index io_file_contents:
CREATE INDEX 'idx_io_file_contents_primary_key' ON 'io_file_contents' ("fileID");
CREATE INDEX 'idx_io_file_contents_createTime' ON 'io_file_contents' ("createTime");
CREATE INDEX 'idx_io_file_contents_content' ON 'io_file_contents' ("content");
DROP TABLE IF EXISTS "io_file_meta";
CREATE TABLE "io_file_meta" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"fileID" integer NOT NULL,
"key" varchar(255) NOT NULL,
"value" text NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index io_file_meta:
CREATE INDEX 'idx_io_file_meta_primary_key' ON 'io_file_meta' ("id");
CREATE UNIQUE INDEX 'idx_io_file_meta_fileID_key' ON 'io_file_meta' ("fileID","key");
CREATE INDEX 'idx_io_file_meta_fileID' ON 'io_file_meta' ("fileID");
CREATE INDEX 'idx_io_file_meta_key' ON 'io_file_meta' ("key");
DROP TABLE IF EXISTS "io_source";
CREATE TABLE "io_source" (
"sourceID" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"sourceHash" varchar(20) NOT NULL,
"targetType" smallint NOT NULL,
"targetID" integer NOT NULL,
"createUser" integer NOT NULL,
"modifyUser" integer NOT NULL,
"isFolder" smallint NOT NULL,
"name" varchar(250) NOT NULL,
"fileType" varchar(10) NOT NULL,
"parentID" integer NOT NULL,
"parentLevel" varchar(2000) NOT NULL,
"fileID" integer NOT NULL,
"isDelete" smallint NOT NULL,
"size" integer NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL,
"viewTime" integer NOT NULL
);
-- index io_source:
CREATE INDEX 'idx_io_source_primary_key' ON 'io_source' ("sourceID");
CREATE INDEX 'idx_io_source_targetType' ON 'io_source' ("targetType");
CREATE INDEX 'idx_io_source_targetID' ON 'io_source' ("targetID");
CREATE INDEX 'idx_io_source_createUser' ON 'io_source' ("createUser");
CREATE INDEX 'idx_io_source_isFolder' ON 'io_source' ("isFolder");
CREATE INDEX 'idx_io_source_parentID' ON 'io_source' ("parentID");
CREATE INDEX 'idx_io_source_parentLevel' ON 'io_source' ("parentLevel");
CREATE INDEX 'idx_io_source_fileID' ON 'io_source' ("fileID");
CREATE INDEX 'idx_io_source_isDelete' ON 'io_source' ("isDelete");
CREATE INDEX 'idx_io_source_size' ON 'io_source' ("size");
CREATE INDEX 'idx_io_source_modifyTime' ON 'io_source' ("modifyTime");
CREATE INDEX 'idx_io_source_createTime' ON 'io_source' ("createTime");
CREATE INDEX 'idx_io_source_viewTime' ON 'io_source' ("viewTime");
CREATE INDEX 'idx_io_source_modifyUser' ON 'io_source' ("modifyUser");
CREATE INDEX 'idx_io_source_targetType_targetID_parentID' ON 'io_source' ("targetType","targetID","parentID");
CREATE INDEX 'idx_io_source_parentID_isDelete' ON 'io_source' ("parentID","isDelete");
CREATE INDEX 'idx_io_source_name' ON 'io_source' ("name");
CREATE INDEX 'idx_io_source_fileType' ON 'io_source' ("fileType");
CREATE INDEX 'idx_io_source_parentID_name' ON 'io_source' ("parentID","name");
DROP TABLE IF EXISTS "io_source_auth";
CREATE TABLE "io_source_auth" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"sourceID" integer NOT NULL,
"targetType" smallint NOT NULL,
"targetID" integer NOT NULL,
"authID" integer NOT NULL,
"authDefine" integer NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index io_source_auth:
CREATE INDEX 'idx_io_source_auth_primary_key' ON 'io_source_auth' ("id");
CREATE INDEX 'idx_io_source_auth_sourceID' ON 'io_source_auth' ("sourceID");
CREATE INDEX 'idx_io_source_auth_userID' ON 'io_source_auth' ("targetType");
CREATE INDEX 'idx_io_source_auth_groupID' ON 'io_source_auth' ("targetID");
CREATE INDEX 'idx_io_source_auth_auth' ON 'io_source_auth' ("authID");
CREATE INDEX 'idx_io_source_auth_authDefine' ON 'io_source_auth' ("authDefine");
DROP TABLE IF EXISTS "io_source_event";
CREATE TABLE "io_source_event" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"sourceID" integer NOT NULL,
"sourceParent" integer NOT NULL,
"userID" integer NOT NULL,
"type" varchar(255) NOT NULL,
"desc" text NOT NULL,
"createTime" integer NOT NULL
);
-- index io_source_event:
CREATE INDEX 'idx_io_source_event_primary_key' ON 'io_source_event' ("id");
CREATE INDEX 'idx_io_source_event_sourceID' ON 'io_source_event' ("sourceID");
CREATE INDEX 'idx_io_source_event_sourceParent' ON 'io_source_event' ("sourceParent");
CREATE INDEX 'idx_io_source_event_userID' ON 'io_source_event' ("userID");
CREATE INDEX 'idx_io_source_event_eventType' ON 'io_source_event' ("type");
CREATE INDEX 'idx_io_source_event_createTime' ON 'io_source_event' ("createTime");
DROP TABLE IF EXISTS "io_source_history";
CREATE TABLE "io_source_history" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"sourceID" integer NOT NULL,
"userID" integer NOT NULL,
"fileID" integer NOT NULL,
"size" integer NOT NULL,
"detail" varchar(1024) NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index io_source_history:
CREATE INDEX 'idx_io_source_history_primary_key' ON 'io_source_history' ("id");
CREATE INDEX 'idx_io_source_history_sourceID' ON 'io_source_history' ("sourceID");
CREATE INDEX 'idx_io_source_history_userID' ON 'io_source_history' ("userID");
CREATE INDEX 'idx_io_source_history_fileID' ON 'io_source_history' ("fileID");
CREATE INDEX 'idx_io_source_history_createTime' ON 'io_source_history' ("createTime");
DROP TABLE IF EXISTS "io_source_meta";
CREATE TABLE "io_source_meta" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"sourceID" integer NOT NULL,
"key" varchar(255) NOT NULL,
"value" text NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index io_source_meta:
CREATE INDEX 'idx_io_source_meta_primary_key' ON 'io_source_meta' ("id");
CREATE UNIQUE INDEX 'idx_io_source_meta_sourceID_key' ON 'io_source_meta' ("sourceID","key");
CREATE INDEX 'idx_io_source_meta_sourceID' ON 'io_source_meta' ("sourceID");
CREATE INDEX 'idx_io_source_meta_key' ON 'io_source_meta' ("key");
DROP TABLE IF EXISTS "io_source_recycle";
CREATE TABLE "io_source_recycle" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"targetType" smallint NOT NULL,
"targetID" integer NOT NULL,
"sourceID" integer NOT NULL,
"userID" integer NOT NULL,
"parentLevel" varchar(2000) NOT NULL,
"createTime" integer NOT NULL
);
-- index io_source_recycle:
CREATE INDEX 'idx_io_source_recycle_primary_key' ON 'io_source_recycle' ("id");
CREATE INDEX 'idx_io_source_recycle_sourceID' ON 'io_source_recycle' ("sourceID");
CREATE INDEX 'idx_io_source_recycle_userID' ON 'io_source_recycle' ("userID");
CREATE INDEX 'idx_io_source_recycle_createTime' ON 'io_source_recycle' ("createTime");
CREATE INDEX 'idx_io_source_recycle_parentLevel' ON 'io_source_recycle' ("parentLevel");
CREATE INDEX 'idx_io_source_recycle_targetType' ON 'io_source_recycle' ("targetType");
CREATE INDEX 'idx_io_source_recycle_targetID' ON 'io_source_recycle' ("targetID");
DROP TABLE IF EXISTS "share";
CREATE TABLE "share" (
"shareID" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"title" varchar(255) NOT NULL,
"shareHash" varchar(50) NOT NULL,
"userID" integer NOT NULL,
"sourceID" integer NOT NULL,
"sourcePath" varchar(1024) NOT NULL,
"url" varchar(255) NOT NULL,
"isLink" smallint NOT NULL,
"isShareTo" smallint NOT NULL,
"password" varchar(255) NOT NULL,
"timeTo" integer NOT NULL,
"numView" integer NOT NULL,
"numDownload" integer NOT NULL,
"options" text,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index share:
CREATE INDEX 'idx_share_primary_key' ON 'share' ("shareID");
CREATE INDEX 'idx_share_userID' ON 'share' ("userID");
CREATE INDEX 'idx_share_createTime' ON 'share' ("createTime");
CREATE INDEX 'idx_share_modifyTime' ON 'share' ("modifyTime");
CREATE INDEX 'idx_share_path' ON 'share' ("sourceID");
CREATE INDEX 'idx_share_sid' ON 'share' ("shareHash");
CREATE INDEX 'idx_share_public' ON 'share' ("isLink");
CREATE INDEX 'idx_share_timeTo' ON 'share' ("timeTo");
CREATE INDEX 'idx_share_numView' ON 'share' ("numView");
CREATE INDEX 'idx_share_numDownload' ON 'share' ("numDownload");
CREATE INDEX 'idx_share_isShareTo' ON 'share' ("isShareTo");
CREATE INDEX 'idx_share_url' ON 'share' ("url");
DROP TABLE IF EXISTS "share_report";
CREATE TABLE "share_report" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"shareID" integer NOT NULL,
"title" varchar(255) NOT NULL,
"sourceID" integer NOT NULL,
"fileID" integer NOT NULL,
"userID" integer NOT NULL,
"type" smallint NOT NULL,
"desc" text NOT NULL,
"status" smallint NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index share_report:
CREATE INDEX 'idx_share_report_primary_key' ON 'share_report' ("id");
CREATE INDEX 'idx_share_report_shareID' ON 'share_report' ("shareID");
CREATE INDEX 'idx_share_report_sourceID' ON 'share_report' ("sourceID");
CREATE INDEX 'idx_share_report_fileID' ON 'share_report' ("fileID");
CREATE INDEX 'idx_share_report_userID' ON 'share_report' ("userID");
CREATE INDEX 'idx_share_report_type' ON 'share_report' ("type");
CREATE INDEX 'idx_share_report_modifyTime' ON 'share_report' ("modifyTime");
CREATE INDEX 'idx_share_report_createTime' ON 'share_report' ("createTime");
DROP TABLE IF EXISTS "share_to";
CREATE TABLE "share_to" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"shareID" integer NOT NULL,
"targetType" smallint NOT NULL,
"targetID" integer NOT NULL,
"authID" integer NOT NULL,
"authDefine" integer NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index share_to:
CREATE INDEX 'idx_share_to_primary_key' ON 'share_to' ("id");
CREATE INDEX 'idx_share_to_shareID' ON 'share_to' ("shareID");
CREATE INDEX 'idx_share_to_userID' ON 'share_to' ("targetType");
CREATE INDEX 'idx_share_to_targetID' ON 'share_to' ("targetID");
CREATE INDEX 'idx_share_to_authDefine' ON 'share_to' ("authDefine");
CREATE INDEX 'idx_share_to_authID' ON 'share_to' ("authID");
DROP TABLE IF EXISTS "system_log";
CREATE TABLE "system_log" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"sessionID" varchar(128) NOT NULL,
"userID" integer NOT NULL,
"type" varchar(255) NOT NULL,
"desc" text NOT NULL,
"createTime" integer NOT NULL
);
-- index system_log:
CREATE INDEX 'idx_system_log_primary_key' ON 'system_log' ("id");
CREATE INDEX 'idx_system_log_userID' ON 'system_log' ("userID");
CREATE INDEX 'idx_system_log_type' ON 'system_log' ("type");
CREATE INDEX 'idx_system_log_createTime' ON 'system_log' ("createTime");
CREATE INDEX 'idx_system_log_sessionID' ON 'system_log' ("sessionID");
DROP TABLE IF EXISTS "system_option";
CREATE TABLE "system_option" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"type" varchar(50) NOT NULL,
"key" varchar(255) NOT NULL,
"value" text NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index system_option:
CREATE INDEX 'idx_system_option_primary_key' ON 'system_option' ("id");
CREATE UNIQUE INDEX 'idx_system_option_key_type' ON 'system_option' ("key","type");
CREATE INDEX 'idx_system_option_createTime' ON 'system_option' ("createTime");
CREATE INDEX 'idx_system_option_modifyTime' ON 'system_option' ("modifyTime");
CREATE INDEX 'idx_system_option_type' ON 'system_option' ("type");
DROP TABLE IF EXISTS "system_session";
CREATE TABLE "system_session" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"sign" varchar(128) NOT NULL,
"userID" integer NOT NULL,
"content" text NOT NULL,
"expires" integer NOT NULL,
"modifyTime" integer NOT NULL,
"createTime" integer NOT NULL
);
-- index system_session:
CREATE INDEX 'idx_system_session_primary_key' ON 'system_session' ("id");
CREATE UNIQUE INDEX 'idx_system_session_sign' ON 'system_session' ("sign");
CREATE INDEX 'idx_system_session_userID' ON 'system_session' ("userID");
CREATE INDEX 'idx_system_session_expires' ON 'system_session' ("expires");
CREATE INDEX 'idx_system_session_modifyTime' ON 'system_session' ("modifyTime");
DROP TABLE IF EXISTS "user";
CREATE TABLE "user" (
"userID" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" varchar(255) NOT NULL,
"roleID" integer NOT NULL,
"email" varchar(255) NOT NULL,
"phone" varchar(20) NOT NULL,
"nickName" varchar(255) NOT NULL,
"avatar" varchar(255) NOT NULL,
"sex" smallint NOT NULL,
"password" varchar(100) NOT NULL,
"sizeMax" integer NOT NULL,
"sizeUse" integer NOT NULL,
"status" smallint NOT NULL,
"lastLogin" integer NOT NULL,
"modifyTime" integer NOT NULL,
"createTime" integer NOT NULL
);
-- index user:
CREATE INDEX 'idx_user_primary_key' ON 'user' ("userID");
CREATE INDEX 'idx_user_name' ON 'user' ("name");
CREATE INDEX 'idx_user_email' ON 'user' ("email");
CREATE INDEX 'idx_user_status' ON 'user' ("status");
CREATE INDEX 'idx_user_modifyTime' ON 'user' ("modifyTime");
CREATE INDEX 'idx_user_lastLogin' ON 'user' ("lastLogin");
CREATE INDEX 'idx_user_createTime' ON 'user' ("createTime");
CREATE INDEX 'idx_user_nickName' ON 'user' ("nickName");
CREATE INDEX 'idx_user_phone' ON 'user' ("phone");
CREATE INDEX 'idx_user_sizeUse' ON 'user' ("sizeUse");
DROP TABLE IF EXISTS "user_fav";
CREATE TABLE "user_fav" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"userID" integer NOT NULL,
"tagID" integer NOT NULL,
"name" varchar(255) NOT NULL,
"path" varchar(2048) NOT NULL,
"type" varchar(20) NOT NULL,
"sort" integer NOT NULL,
"modifyTime" integer NOT NULL,
"createTime" integer NOT NULL
);
-- index user_fav:
CREATE INDEX 'idx_user_fav_primary_key' ON 'user_fav' ("id");
CREATE INDEX 'idx_user_fav_createTime' ON 'user_fav' ("createTime");
CREATE INDEX 'idx_user_fav_userID' ON 'user_fav' ("userID");
CREATE INDEX 'idx_user_fav_name' ON 'user_fav' ("name");
CREATE INDEX 'idx_user_fav_sort' ON 'user_fav' ("sort");
CREATE INDEX 'idx_user_fav_tagID' ON 'user_fav' ("tagID");
CREATE INDEX 'idx_user_fav_path' ON 'user_fav' ("path");
CREATE INDEX 'idx_user_fav_type' ON 'user_fav' ("type");
DROP TABLE IF EXISTS "user_group";
CREATE TABLE "user_group" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"userID" integer NOT NULL,
"groupID" integer NOT NULL,
"authID" integer NOT NULL,
"sort" integer NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index user_group:
CREATE INDEX 'idx_user_group_primary_key' ON 'user_group' ("id");
CREATE UNIQUE INDEX 'idx_user_group_userID_groupID' ON 'user_group' ("userID","groupID");
CREATE INDEX 'idx_user_group_userID' ON 'user_group' ("userID");
CREATE INDEX 'idx_user_group_groupID' ON 'user_group' ("groupID");
CREATE INDEX 'idx_user_group_groupRole' ON 'user_group' ("authID");
CREATE INDEX 'idx_user_group_sort' ON 'user_group' ("sort");
DROP TABLE IF EXISTS "user_meta";
CREATE TABLE "user_meta" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"userID" integer NOT NULL,
"key" varchar(255) NOT NULL,
"value" text NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index user_meta:
CREATE INDEX 'idx_user_meta_primary_key' ON 'user_meta' ("id");
CREATE UNIQUE INDEX 'idx_user_meta_userID_metaKey' ON 'user_meta' ("userID","key");
CREATE INDEX 'idx_user_meta_userID' ON 'user_meta' ("userID");
CREATE INDEX 'idx_user_meta_metaKey' ON 'user_meta' ("key");
DROP TABLE IF EXISTS "user_option";
CREATE TABLE "user_option" (
"id" integer NOT NULL PRIMARY KEY AUTOINCREMENT,
"userID" integer NOT NULL,
"type" varchar(50) NOT NULL,
"key" varchar(255) NOT NULL,
"value" text NOT NULL,
"createTime" integer NOT NULL,
"modifyTime" integer NOT NULL
);
-- index user_option:
CREATE INDEX 'idx_user_option_primary_key' ON 'user_option' ("id");
CREATE UNIQUE INDEX 'idx_user_option_userID_key_type' ON 'user_option' ("userID","key","type");
CREATE INDEX 'idx_user_option_userID' ON 'user_option' ("userID");
CREATE INDEX 'idx_user_option_type' ON 'user_option' ("type");
CREATE INDEX 'idx_user_option_key' ON 'user_option' ("key");