From aa97e05df97f9592d5a6366b298d1cb99c1533e3 Mon Sep 17 00:00:00 2001 From: Matt Krick Date: Wed, 1 May 2024 15:15:32 -0700 Subject: [PATCH] fix: remove oneOnOne column in Team table (#9696) Signed-off-by: Matt Krick --- .../1714579256634_removeOneOnOneTeam.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 packages/server/postgres/migrations/1714579256634_removeOneOnOneTeam.ts diff --git a/packages/server/postgres/migrations/1714579256634_removeOneOnOneTeam.ts b/packages/server/postgres/migrations/1714579256634_removeOneOnOneTeam.ts new file mode 100644 index 00000000000..8352e12f597 --- /dev/null +++ b/packages/server/postgres/migrations/1714579256634_removeOneOnOneTeam.ts @@ -0,0 +1,22 @@ +import {Client} from 'pg' +import getPgConfig from '../getPgConfig' + +export async function up() { + const client = new Client(getPgConfig()) + await client.connect() + await client.query(` + ALTER TABLE "Team" + DROP COLUMN IF EXISTS "isOneOnOneTeam"; + `) + await client.end() +} + +export async function down() { + const client = new Client(getPgConfig()) + await client.connect() + await client.query(` + ALTER TABLE "Team" + ADD COLUMN IF NOT EXISTS "isOneOnOneTeam" BOOLEAN NOT NULL DEFAULT FALSE; + `) + await client.end() +}