Skip to content

Commit

Permalink
chore:rename
Browse files Browse the repository at this point in the history
  • Loading branch information
taolx0 committed Jul 31, 2023
1 parent 3af45c7 commit 984b740
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sqle/model/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ type WorkflowInstanceRecord struct {
IsSQLExecuted bool
ExecutionUserId uint

ExecutorUserList []*User `gorm:"many2many:workflow_instance_record_user"`
Instance *Instance `gorm:"foreignkey:InstanceId"`
Task *Task `gorm:"foreignkey:TaskId"`
User *User `gorm:"foreignkey:ExecutionUserId"`
ExecutionAssignees []*User `gorm:"many2many:workflow_instance_record_user"`
Instance *Instance `gorm:"foreignkey:InstanceId"`
Task *Task `gorm:"foreignkey:TaskId"`
User *User `gorm:"foreignkey:ExecutionUserId"`
}

func (wir *WorkflowInstanceRecord) ExecuteUserName() string {
Expand Down Expand Up @@ -423,9 +423,9 @@ func (s *Storage) CreateWorkflowV2(subject, workflowId, desc string, user *User,
allExecutor[i] = executor

instanceRecords[i] = &WorkflowInstanceRecord{
TaskId: task.ID,
InstanceId: task.InstanceId,
ExecutorUserList: executor,
TaskId: task.ID,
InstanceId: task.InstanceId,
ExecutionAssignees: executor,
}
}

Expand Down Expand Up @@ -468,7 +468,7 @@ func (s *Storage) CreateWorkflowV2(subject, workflowId, desc string, user *User,
}

for _, instanceRecord := range record.InstanceRecords {
if tx.Model(instanceRecord).Association("ExecutorUserList").Replace(instanceRecord.ExecutorUserList).Error != nil {
if tx.Model(instanceRecord).Association("ExecutionAssignees").Replace(instanceRecord.ExecutionAssignees).Error != nil {
tx.Rollback()
return errors.New(errors.ConnectStorageError, err)
}
Expand Down

0 comments on commit 984b740

Please sign in to comment.