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; + `); +};