Skip to content

Commit

Permalink
change model
Browse files Browse the repository at this point in the history
  • Loading branch information
710leo committed Apr 6, 2024
1 parent 8b1a788 commit d752cb9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/models/task_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ import (

type TaskHost struct {
II int64 `gorm:"column:ii;primaryKey;autoIncrement" json:"-"`
Id int64 `gorm:"column:id;uniqueIndex:idx_id_host;not null"`
Host string `gorm:"column:host;uniqueIndex:idx_id_host;size:128;not null"`
Status string `gorm:"column:status;size:32;not null"`
Stdout string `gorm:"column:stdout;type:text"`
Stderr string `gorm:"column:stderr;type:text"`
Id int64 `gorm:"column:id;uniqueIndex:idx_id_host;not null" json:"id"`
Host string `gorm:"column:host;uniqueIndex:idx_id_host;size:128;not null" json:"host"`
Status string `gorm:"column:status;size:32;not null" json:"status"`
Stdout string `gorm:"column:stdout;type:text" json:"stdout"`
Stderr string `gorm:"column:stderr;type:text" json:"stderr"`
}

func (taskHost *TaskHost) Upsert() error {
Expand Down
24 changes: 12 additions & 12 deletions src/models/task_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ import (
)

type TaskMeta struct {
Id int64 `gorm:"column:id;primaryKey;autoIncrement"`
Title string `gorm:"column:title;size:255;not null;default:''"`
Account string `gorm:"column:account;size:64;not null"`
Batch int `gorm:"column:batch;not null;default:0"`
Tolerance int `gorm:"column:tolerance;not null;default:0"`
Timeout int `gorm:"column:timeout;not null;default:0"`
Pause string `gorm:"column:pause;size:255;not null;default:''"`
Script string `gorm:"column:script;type:text;not null"`
Args string `gorm:"column:args;size:512;not null;default:''"`
Stdin string `gorm:"column:stdin;size:1024;not null;default:''"`
Creator string `gorm:"column:creator;size:64;not null;default:'';index"`
Created time.Time `gorm:"column:created;not null;default:CURRENT_TIMESTAMP;type:timestamp;index"`
Id int64 `gorm:"column:id;primaryKey;autoIncrement" json:"id"`
Title string `gorm:"column:title;size:255;not null;default:''" json:"title"`
Account string `gorm:"column:account;size:64;not null" json:"account"`
Batch int `gorm:"column:batch;not null;default:0" json:"batch"`
Tolerance int `gorm:"column:tolerance;not null;default:0" json:"tolerance"`
Timeout int `gorm:"column:timeout;not null;default:0" json:"timeout"`
Pause string `gorm:"column:pause;size:255;not null;default:''" json:"pause"`
Script string `gorm:"column:script;type:text;not null" json:"script"`
Args string `gorm:"column:args;size:512;not null;default:''" json:"args"`
Stdin string `gorm:"column:stdin;size:1024;not null;default:''" json:"stdin"`
Creator string `gorm:"column:creator;size:64;not null;default:'';index" json:"creator"`
Created time.Time `gorm:"column:created;not null;default:CURRENT_TIMESTAMP;type:timestamp;index" json:"created"`
Done bool `json:"done" gorm:"-"`
}

Expand Down

0 comments on commit d752cb9

Please sign in to comment.