From a71fd2cdb73fff53c91ea04a4c85f3f0529e994a Mon Sep 17 00:00:00 2001 From: Bogdans Ozerkins Date: Tue, 15 Aug 2023 10:07:35 -0700 Subject: [PATCH] fix: model migration not null breaks upgrade (#170) --- cmd/argo-watcher/state/state_models/task_model.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/argo-watcher/state/state_models/task_model.go b/cmd/argo-watcher/state/state_models/task_model.go index 27b3ee59..b14275f6 100644 --- a/cmd/argo-watcher/state/state_models/task_model.go +++ b/cmd/argo-watcher/state/state_models/task_model.go @@ -12,13 +12,13 @@ import ( type TaskModel struct { Id uuid.UUID `gorm:"column:id;type:uuid;default:gen_random_uuid()"` Created time.Time `gorm:"column:created;autoCreateTime;not null;index;"` - Updated time.Time `gorm:"column:updated;autoUpdateTime;not null;"` + Updated time.Time `gorm:"column:updated;autoUpdateTime;"` Images datatypes.JSONSlice[models.Image] `gorm:"column:images;not null;"` Status string `gorm:"column:status;type:VARCHAR(20);not null;index;"` - ApplicationName sql.NullString `gorm:"column:app;type:VARCHAR(255);not null;"` - Author sql.NullString `gorm:"column:author;type:VARCHAR(255);not null;"` - Project sql.NullString `gorm:"column:project;type:VARCHAR(255);not null;"` - StatusReason sql.NullString `gorm:"column:status_reason;default:''"` + ApplicationName sql.NullString `gorm:"column:app;type:VARCHAR(255);"` + Author sql.NullString `gorm:"column:author;type:VARCHAR(255);"` + Project sql.NullString `gorm:"column:project;type:VARCHAR(255);"` + StatusReason sql.NullString `gorm:"column:status_reason;"` } func (TaskModel) TableName() string {