refactor: remove dataset cron records
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type SaDatasetCron struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
Identity string `gorm:"type:char(36);uniqueIndex"`
|
||||
SourceID uint `gorm:"index;not null"`
|
||||
SourceIdentity string `gorm:"type:char(36);index"`
|
||||
CreatedBy uint `gorm:"index;not null"`
|
||||
CreatedByIdentity string `gorm:"type:char(36);index"`
|
||||
Schedule string `gorm:"size:100;not null"`
|
||||
Status string `gorm:"size:32;not null;default:pending;index"`
|
||||
Enabled bool `gorm:"not null;default:true;index"`
|
||||
NextRunAt *time.Time
|
||||
LastRunAt *time.Time
|
||||
LastResult string `gorm:"type:text"`
|
||||
CreatedAt time.Time `gorm:"index"`
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
func (SaDatasetCron) TableName() string {
|
||||
return "sa_dataset_crons"
|
||||
}
|
||||
@@ -36,16 +36,6 @@ func (m *SaDatasetItem) BeforeCreate(tx *gorm.DB) error {
|
||||
return resolveIdentity(tx, &SaDatasetSource{}, m.SourceID, &m.SourceIdentity)
|
||||
}
|
||||
|
||||
func (m *SaDatasetCron) BeforeCreate(tx *gorm.DB) error {
|
||||
if err := ensureIdentity(&m.Identity); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := resolveIdentity(tx, &SaDatasetSource{}, m.SourceID, &m.SourceIdentity); err != nil {
|
||||
return err
|
||||
}
|
||||
return resolveIdentity(tx, &SaUser{}, m.CreatedBy, &m.CreatedByIdentity)
|
||||
}
|
||||
|
||||
func (m *SaInboxItem) BeforeCreate(tx *gorm.DB) error {
|
||||
if err := ensureIdentity(&m.Identity); err != nil {
|
||||
return err
|
||||
|
||||
@@ -33,7 +33,6 @@ func AutoMigrate(database *gorm.DB) error {
|
||||
&SaProject{},
|
||||
&SaDatasetSource{},
|
||||
&SaDatasetItem{},
|
||||
&SaDatasetCron{},
|
||||
&SaInboxItem{},
|
||||
&SaInboxSuggestion{},
|
||||
&SaTask{},
|
||||
|
||||
Reference in New Issue
Block a user