更改数据库字段长度

pull/21/merge
ouqiang 2017-04-25 19:05:24 +08:00
parent ce5cc5533e
commit 638aed88cf
5 changed files with 13 additions and 13 deletions

View File

@ -4,8 +4,8 @@
## 安装, 解压后执行 ## 安装, 解压后执行
```shell ```shell
Windows ./gocron.exe server Windows ./gocron.exe web
Linux、OSX ./gocron server Linux、OSX ./gocron web
``` ```
可选参数 可选参数
+ -p 端口, 指定端口, 默认5920 + -p 端口, 指定端口, 默认5920

View File

@ -15,8 +15,8 @@ import (
const DefaultPort = 5920 const DefaultPort = 5920
var CmdWeb = cli.Command{ var CmdWeb = cli.Command{
Name: "server", Name: "web",
Usage: "start scheduler web server", Usage: "run web server",
Action: run, Action: run,
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.IntFlag{ cli.IntFlag{

View File

@ -10,12 +10,12 @@ import (
// 主机 // 主机
type Host struct { type Host struct {
Id int16 `xorm:"smallint pk autoincr"` Id int16 `xorm:"smallint pk autoincr"`
Name string `xorm:"varchar(128) notnull"` // 主机名称 Name string `xorm:"varchar(64) notnull"` // 主机名称
Alias string `xorm:"varchar(32) notnull default '' "` // 主机别名 Alias string `xorm:"varchar(32) notnull default '' "` // 主机别名
Username string `xorm:"varchar(32) notnull default '' "` // ssh 用户名 Username string `xorm:"varchar(32) notnull default '' "` // ssh 用户名
Password string `xorm:"varchar(64) notnull default ''"` // ssh 密码 Password string `xorm:"varchar(64) notnull default ''"` // ssh 密码
Port int `xorm:"notnull default 22"` // 主机端口 Port int `xorm:"notnull default 22"` // 主机端口
Remark string `xorm:"varchar(512) notnull default '' "` // 备注 Remark string `xorm:"varchar(256) notnull default '' "` // 备注
AuthType ssh.HostAuthType `xorm:"tinyint notnull default 1"` // 认证方式 1: 密码 2: 公钥 AuthType ssh.HostAuthType `xorm:"tinyint notnull default 1"` // 认证方式 1: 密码 2: 公钥
PrivateKey string `xorm:"varchar(4096) notnull default '' "` // 私钥 PrivateKey string `xorm:"varchar(4096) notnull default '' "` // 私钥
BaseModel `xorm:"-"` BaseModel `xorm:"-"`

View File

@ -17,14 +17,14 @@ const (
// 任务 // 任务
type Task struct { type Task struct {
Id int `xorm:"int pk autoincr"` Id int `xorm:"int pk autoincr"`
Name string `xorm:"varchar(64) notnull"` // 任务名称 Name string `xorm:"varchar(32) notnull"` // 任务名称
Spec string `xorm:"varchar(64) notnull"` // crontab Spec string `xorm:"varchar(64) notnull"` // crontab
Protocol TaskProtocol `xorm:"tinyint notnull"` // 协议 1:http 2:ssh-command 3: 系统命令 Protocol TaskProtocol `xorm:"tinyint notnull"` // 协议 1:http 2:ssh-command 3: 系统命令
Command string `xorm:"varchar(512) notnull"` // URL地址或shell命令 Command string `xorm:"varchar(256) notnull"` // URL地址或shell命令
Timeout int `xorm:"mediumint notnull default 0"` // 任务执行超时时间(单位秒),0不限制 Timeout int `xorm:"mediumint notnull default 0"` // 任务执行超时时间(单位秒),0不限制
RetryTimes int8 `xorm:"tinyint notnull default 0"` // 重试次数 RetryTimes int8 `xorm:"tinyint notnull default 0"` // 重试次数
HostId int16 `xorm:"smallint notnull default 0"` // SSH host id HostId int16 `xorm:"smallint notnull default 0"` // SSH host id
Remark string `xorm:"varchar(512) notnull default ''"` // 备注 Remark string `xorm:"varchar(256) notnull default ''"` // 备注
Created time.Time `xorm:"datetime notnull created"` // 创建时间 Created time.Time `xorm:"datetime notnull created"` // 创建时间
Deleted time.Time `xorm:"datetime deleted"` // 删除时间 Deleted time.Time `xorm:"datetime deleted"` // 删除时间
Status Status `xorm:"tinyint notnull default 1"` // 状态 1:正常 0:停止 Status Status `xorm:"tinyint notnull default 1"` // 状态 1:正常 0:停止

View File

@ -12,17 +12,17 @@ type TaskType int8
type TaskLog struct { type TaskLog struct {
Id int64 `xorm:"bigint pk autoincr"` Id int64 `xorm:"bigint pk autoincr"`
TaskId int `xorm:"int notnull index default 0"` // 任务id TaskId int `xorm:"int notnull index default 0"` // 任务id
Name string `xorm:"varchar(64) notnull"` // 任务名称 Name string `xorm:"varchar(32) notnull"` // 任务名称
Spec string `xorm:"varchar(64) notnull"` // crontab Spec string `xorm:"varchar(64) notnull"` // crontab
Protocol TaskProtocol `xorm:"tinyint notnull"` // 协议 1:http 2:ssh-command 3:系统命令 Protocol TaskProtocol `xorm:"tinyint notnull"` // 协议 1:http 2:ssh-command 3:系统命令
Command string `xorm:"varchar(512) notnull"` // URL地址或shell命令 Command string `xorm:"varchar(256) notnull"` // URL地址或shell命令
Timeout int `xorm:"mediumint notnull default 0"` // 任务执行超时时间(单位秒),0不限制 Timeout int `xorm:"mediumint notnull default 0"` // 任务执行超时时间(单位秒),0不限制
RetryTimes int8 `xorm:"tinyint notnull default 0"` // 任务重试次数 RetryTimes int8 `xorm:"tinyint notnull default 0"` // 任务重试次数
Hostname string `xorm:"varchar(512) notnull defalut '' "` // SSH主机名逗号分隔 Hostname string `xorm:"varchar(256) notnull defalut '' "` // SSH主机名逗号分隔
StartTime time.Time `xorm:"datetime created"` // 开始执行时间 StartTime time.Time `xorm:"datetime created"` // 开始执行时间
EndTime time.Time `xorm:"datetime updated"` // 执行完成(失败)时间 EndTime time.Time `xorm:"datetime updated"` // 执行完成(失败)时间
Status Status `xorm:"tinyint notnull default 1"` // 状态 0:执行失败 1:执行中 2:执行完毕 Status Status `xorm:"tinyint notnull default 1"` // 状态 0:执行失败 1:执行中 2:执行完毕
Result string `xorm:"varchar(65535) notnull defalut '' "` // 执行结果 Result string `xorm:"varchar(10000) notnull defalut '' "` // 执行结果
TotalTime int `xorm:"-"` // 执行总时长 TotalTime int `xorm:"-"` // 执行总时长
BaseModel `xorm:"-"` BaseModel `xorm:"-"`
} }