mirror of
https://github.com/GlueOps/autoglue.git
synced 2026-02-13 12:50:05 +01:00
initial jobs to bootstrap bastion with docker
This commit is contained in:
@@ -31,6 +31,7 @@ func Connect() {
|
||||
&models.Credential{},
|
||||
&models.EmailVerification{},
|
||||
&models.Invitation{},
|
||||
&models.Job{},
|
||||
&models.Label{},
|
||||
&models.MasterKey{},
|
||||
&models.Member{},
|
||||
|
||||
22
internal/db/models/jobs.go
Normal file
22
internal/db/models/jobs.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/datatypes"
|
||||
)
|
||||
|
||||
type Job struct {
|
||||
ID string `gorm:"type:varchar;primaryKey" json:"id"` // no default; supply from app
|
||||
QueueName string `gorm:"type:varchar;not null" json:"queue_name"`
|
||||
Status string `gorm:"type:varchar;not null" json:"status"`
|
||||
Arguments datatypes.JSON `gorm:"type:jsonb;not null;default:'{}'"`
|
||||
Result datatypes.JSON `gorm:"type:jsonb;not null;default:'{}'"`
|
||||
LastError *string `gorm:"type:varchar"`
|
||||
RetryCount int `gorm:"not null;default:0"`
|
||||
MaxRetry int `gorm:"not null;default:0"`
|
||||
RetryInterval int `gorm:"not null;default:0"`
|
||||
ScheduledAt time.Time `gorm:"type:timestamptz;default:now();index"`
|
||||
StartedAt *time.Time `gorm:"type:timestamptz;index"`
|
||||
Timestamped
|
||||
}
|
||||
Reference in New Issue
Block a user