From e145068287e3657af7af81ff53b9409f96310059 Mon Sep 17 00:00:00 2001 From: mannilakash Date: Mon, 13 Apr 2026 08:34:02 -0400 Subject: [PATCH] fix: adding migration changes - TimescaleDB - userAgent --- .../timescaledb/0022_add_user_agent_fields.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 server/src/db/migration/timescaledb/0022_add_user_agent_fields.ts diff --git a/server/src/db/migration/timescaledb/0022_add_user_agent_fields.ts b/server/src/db/migration/timescaledb/0022_add_user_agent_fields.ts new file mode 100644 index 000000000..dd215158c --- /dev/null +++ b/server/src/db/migration/timescaledb/0022_add_user_agent_fields.ts @@ -0,0 +1,21 @@ +import type { Pool } from "pg"; + +export const addUserAgentFields = async (pool: Pool) => { + await pool.query(` + ALTER TABLE monitors + ADD COLUMN IF NOT EXISTS custom_user_agent TEXT; + + ALTER TABLE app_settings + ADD COLUMN IF NOT EXISTS default_user_agent TEXT; + `); +}; + +export const dropUserAgentFields = async (pool: Pool) => { + await pool.query(` + ALTER TABLE monitors + DROP COLUMN IF EXISTS custom_user_agent; + + ALTER TABLE app_settings + DROP COLUMN IF EXISTS default_user_agent; + `); +};