fix: complete exploration data flow
This commit is contained in:
@@ -14,8 +14,8 @@ type SaDatasetCron struct {
|
||||
Enabled bool `gorm:"not null;default:true;index"`
|
||||
NextRunAt *time.Time
|
||||
LastRunAt *time.Time
|
||||
LastResult string `gorm:"type:text"`
|
||||
CreatedAt time.Time
|
||||
LastResult string `gorm:"type:text"`
|
||||
CreatedAt time.Time `gorm:"index"`
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package models
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"errors"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
@@ -28,6 +29,9 @@ func (m *SaDatasetSource) BeforeCreate(tx *gorm.DB) error {
|
||||
if m.CreatedBy == 0 {
|
||||
m.CreatedBy = m.OwnerID
|
||||
}
|
||||
if m.OwnerID == 0 {
|
||||
return errors.New("dataset source owner is required")
|
||||
}
|
||||
if err := resolveIdentity(tx, &SaUser{}, m.OwnerID, &m.OwnerIdentity); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user