Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat: add task run log table (#11913)

p0nyeba17839f1e1
diff --git a/backend/migrator/migration/prod/2.17/0001##task_run_log.sql b/backend/migrator/migration/prod/2.17/0001##task_run_log.sql
new file mode 100644
index 0000000000..9f79c15eed
--- /dev/null
+++ b/backend/migrator/migration/prod/2.17/0001##task_run_log.sql
@@ -0,0 +1,10 @@
+CREATE TABLE task_run_log (
+ id BIGSERIAL PRIMARY KEY,
+ task_run_id INTEGER NOT NULL REFERENCES task_run (id),
+ created_ts TIMESTAMP NOT NULL DEFAULT now(),
+ payload JSONB NOT NULL DEFAULT '{}'
+);
+
+CREATE INDEX idx_task_run_log_task_run_id ON task_run_log(task_run_id);
+
+ALTER SEQUENCE task_run_log_id_seq RESTART WITH 101;
diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sql
index 602be93959..50842da4d8 100644
--- a/backend/migrator/migration/prod/LATEST.sql
+++ b/backend/migrator/migration/prod/LATEST.sql
@@ -503,6 +503,17 @@ CREATE UNIQUE INDEX uk_task_run_task_id_attempt ON task_run (task_id, attempt);
ALTER SEQUENCE task_run_id_seq RESTART WITH 101;
+CREATE TABLE task_run_log (
+ id BIGSERIAL PRIMARY KEY,
+ task_run_id INTEGER NOT NULL REFERENCES task_run (id),
+ created_ts TIMESTAMP NOT NULL DEFAULT now(),
+ payload JSONB NOT NULL DEFAULT '{}'
+);
+
+CREATE INDEX idx_task_run_log_task_run_id ON task_run_log(task_run_id);
+
+ALTER SEQUENCE task_run_log_id_seq RESTART WITH 101;
+
-- Pipeline related END
-----------------------
-- Plan related BEGIN
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index e723b41692..bb779b59d8 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -230,5 +230,5 @@ func TestMigrationCompatibility(t *testing.T) {
func TestGetCutoffVersion(t *testing.T) {
releaseVersion, err := getProdCutoffVersion()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("2.17.0"), releaseVersion)
+ require.Equal(t, semver.MustParse("2.17.1"), releaseVersion)
}