Skip to content

Commit

Permalink
Merge pull request #921 from actiontech/db_type
Browse files Browse the repository at this point in the history
In the same sql mode, the data source type must be the same
  • Loading branch information
ColdWaterLW authored Sep 30, 2022
2 parents 23f3a81 + f68d0e0 commit 2c265be
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sqle/model/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,16 @@ func (s *Storage) CreateWorkflow(subject, desc string, user *User, tasks []*Task
}
}

// 相同sql模式下,数据源类型必须相同
if workflowMode == WorkflowModeSameSQLs && len(tasks) > 1 {
dbType := tasks[0].Instance.DbType
for _, task := range tasks {
if dbType != task.Instance.DbType {
return errors.New(errors.DataConflict, fmt.Errorf("the instance types must be the same"))
}
}
}

workflow := &Workflow{
Subject: subject,
Desc: desc,
Expand Down

0 comments on commit 2c265be

Please sign in to comment.