Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
Chnage task_run_id to use INTEGER AUTOINCREMENT
天舟97fc476514c5
diff --git a/backend/scheduler/default_task_run_service.go b/backend/scheduler/default_task_run_service.goindex d870d844d0..c04c4cc822 100644--- a/backend/scheduler/default_task_run_service.go+++ b/backend/scheduler/default_task_run_service.go@@ -111,17 +111,15 @@ func (s *DefaultTaskRunService) PatchTaskRunStatus(ctx context.Context, patch *Tfunc createTaskRun(ctx context.Context, tx *sql.Tx, create *TaskRunCreate) (*TaskRun, error) {row, err := tx.QueryContext(ctx, `INSERT INTO task_run (- id,task_id,name,`+"`status`,"+``+"`type`,"+`payload)- VALUES (?, ?, ?, 'PENDING', ?, ?)+ VALUES (?, ?, 'PENDING', ?, ?)RETURNING id, created_ts, updated_ts, task_id, name, `+"`status`, `type`, payload"+``,- create.ID,create.TaskId,create.Name,create.Type,@@ -163,7 +161,7 @@ func findTaskRunList(ctx context.Context, tx *sql.Tx, find *TaskRunFind) (_ []*Trows, err := tx.QueryContext(ctx, `SELECT- id,+ id,created_ts,updated_ts,task_id,diff --git a/backend/scheduler/scheduler.go b/backend/scheduler/scheduler.goindex 98561a5fd9..6dec499541 100644--- a/backend/scheduler/scheduler.go+++ b/backend/scheduler/scheduler.go@@ -6,8 +6,6 @@ import ("fmt""log""time"-- uuid "github.com/satori/go.uuid")const (@@ -81,7 +79,6 @@ func (s *Scheduler) Register(taskType string, executor Executor) {func (s *Scheduler) Schedule(task Task) (*TaskRun, error) {taskRunCreate := &TaskRunCreate{- ID: uuid.NewV4().String(),TaskId: task.ID,Name: task.Name,Type: task.Type,diff --git a/backend/scheduler/task.go b/backend/scheduler/task.goindex 943bc9c897..8a90949b76 100644--- a/backend/scheduler/task.go+++ b/backend/scheduler/task.go@@ -52,7 +52,6 @@ type TaskRun struct {}type TaskRunCreate struct {- ID TaskRunIdTaskId TaskIdName stringType stringdiff --git a/backend/store/migration/0001_init_schema.up.sql b/backend/store/migration/0001_init_schema.up.sqlindex 32d201eb29..023c08f65d 100644--- a/backend/store/migration/0001_init_schema.up.sql+++ b/backend/store/migration/0001_init_schema.up.sql@@ -499,7 +499,7 @@ END;-- task run table stores the task runCREATE TABLE task_run (- id TEXT PRIMARY KEY,+ id INTEGER PRIMARY KEY AUTOINCREMENT,created_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),updated_ts BIGINT NOT NULL DEFAULT (strftime('%s', 'now')),task_id INTEGER NOT NULL REFERENCES task (id),@@ -517,6 +517,11 @@ CREATE TABLE task_run (payload TEXT NOT NULL DEFAULT '');+INSERT INTO+ sqlite_sequence (name, seq)+VALUES+ ('task_run', 1000);+CREATE TRIGGER IF NOT EXISTS `trigger_update_task_run_modification_time`AFTERUPDATE