-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(kudos): add kudos team settings (#9163)
* chore(kudos): add kudos team settings * store emoji id
- Loading branch information
1 parent
c719112
commit 97fba6c
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/server/postgres/migrations/1699448432969_teamKudosSettings.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import {Client} from 'pg' | ||
import getPgConfig from '../getPgConfig' | ||
|
||
export async function up() { | ||
const client = new Client(getPgConfig()) | ||
await client.connect() | ||
await client.query(` | ||
DO $$ | ||
BEGIN | ||
ALTER TABLE "Team" | ||
ADD COLUMN IF NOT EXISTS "giveKudosWithEmoji" BOOLEAN NOT NULL DEFAULT TRUE, | ||
ADD COLUMN IF NOT EXISTS "kudosEmoji" TEXT NOT NULL DEFAULT 'heart'; | ||
END | ||
$$; | ||
`) | ||
await client.end() | ||
} | ||
|
||
export async function down() { | ||
const client = new Client(getPgConfig()) | ||
await client.connect() | ||
await client.query(` | ||
DO $$ | ||
BEGIN | ||
ALTER TABLE "Team" | ||
DROP COLUMN "giveKudosWithEmoji", | ||
DROP COLUMN "kudosEmoji"; | ||
END | ||
$$; | ||
`) | ||
await client.end() | ||
} |