Skip to content

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

chore: use timestamptz (#12064)

p0ny1808b938ac4e
diff --git a/backend/migrator/migration/prod/2.18/0003##fix_task_run_log_ts.sql b/backend/migrator/migration/prod/2.18/0003##fix_task_run_log_ts.sql
new file mode 100644
index 0000000000..86c871721e
--- /dev/null
+++ b/backend/migrator/migration/prod/2.18/0003##fix_task_run_log_ts.sql
@@ -0,0 +1,3 @@
+SET timezone = 'UTC';
+ALTER TABLE task_run_log ALTER created_ts TYPE TIMESTAMPTZ;
+RESET timezone;
diff --git a/backend/migrator/migration/prod/LATEST.sql b/backend/migrator/migration/prod/LATEST.sql
index 44eec5b1f1..1efda2a53c 100644
--- a/backend/migrator/migration/prod/LATEST.sql
+++ b/backend/migrator/migration/prod/LATEST.sql
@@ -506,7 +506,7 @@ 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(),
+ created_ts TIMESTAMPTZ NOT NULL DEFAULT now(),
payload JSONB NOT NULL DEFAULT '{}'
);
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 0df740e02e..b4ff8cb6c0 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.18.2"), releaseVersion)
+ require.Equal(t, semver.MustParse("2.18.3"), releaseVersion)
}