summary refs log tree commit diff
path: root/src/util/migration/postgres/1719776735000-newUserSettings.ts
blob: dbee0b0d5ae5f3ca9a8f8bc3fde310caadb40dbd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { MigrationInterface, QueryRunner } from "typeorm";

export class NewUserSettings1719776735000 implements MigrationInterface {
	name = "NewUserSettings1719776735000";

	public async up(queryRunner: QueryRunner): Promise<void> {
		await queryRunner.query(
			"ALTER TABLE user_settings ADD COLUMN friend_discovery_flags integer DEFAULT 0;",
		);
		await queryRunner.query(
			"ALTER TABLE user_settings ADD COLUMN view_nsfw_guilds boolean DEFAULT true;",
		);
	}

	public async down(queryRunner: QueryRunner): Promise<void> {
		await queryRunner.query(
			"ALTER TABLE user_settings DROP COLUMN friend_discovery_flags;",
		);
		await queryRunner.query(
			"ALTER TABLE user_settings DROP COLUMN view_nsfw_guilds;",
		);
	}
}