-
Notifications
You must be signed in to change notification settings - Fork 382
/
install.sql
61 lines (55 loc) · 3.01 KB
/
install.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
CREATE TABLE `t_task` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
`group_id` int(11) NOT NULL DEFAULT '0' COMMENT '分组ID',
`task_name` varchar(50) NOT NULL DEFAULT '' COMMENT '任务名称',
`task_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '任务类型',
`description` varchar(200) NOT NULL DEFAULT '' COMMENT '任务描述',
`cron_spec` varchar(100) NOT NULL DEFAULT '' COMMENT '时间表达式',
`concurrent` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否只允许一个实例',
`command` text NOT NULL COMMENT '命令详情',
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0停用 1启用',
`notify` tinyint(4) NOT NULL DEFAULT '0' COMMENT '通知设置',
`notify_email` text NOT NULL COMMENT '通知人列表',
`timeout` smallint(6) NOT NULL DEFAULT '0' COMMENT '超时设置',
`execute_times` int(11) NOT NULL DEFAULT '0' COMMENT '累计执行次数',
`prev_time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '上次执行时间',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_user_id` (`user_id`),
KEY `idx_group_id` (`group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `t_task_group` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL DEFAULT '0' COMMENT '用户ID',
`group_name` varchar(50) NOT NULL DEFAULT '' COMMENT '组名',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '说明',
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_user_id` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `t_task_log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`task_id` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '任务ID',
`output` mediumtext NOT NULL COMMENT '任务输出',
`error` text NOT NULL COMMENT '错误信息',
`status` tinyint(4) NOT NULL COMMENT '状态',
`process_time` int(11) NOT NULL DEFAULT '0' COMMENT '消耗时间/毫秒',
`create_time` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_task_id` (`task_id`,`create_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `t_user` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`user_name` varchar(20) NOT NULL DEFAULT '' COMMENT '用户名',
`email` varchar(50) NOT NULL DEFAULT '' COMMENT '邮箱',
`password` char(32) NOT NULL DEFAULT '' COMMENT '密码',
`salt` char(10) NOT NULL DEFAULT '' COMMENT '密码盐',
`last_login` int(11) NOT NULL DEFAULT '0' COMMENT '最后登录时间',
`last_ip` char(15) NOT NULL DEFAULT '' COMMENT '最后登录IP',
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态,0正常 -1禁用',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_user_name` (`user_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `t_user` (`id`, `user_name`, `email`, `password`, `salt`, `last_login`, `last_ip`, `status`)
VALUES (1,'admin','[email protected]','7fef6171469e80d32c0559f88b377245','',0,'',0);