Add migration for new user setting props
This commit is contained in:
parent
2d8238f286
commit
12cca1b546
23
src/util/migration/mariadb/1719776735000-newUserSettings.ts
Normal file
23
src/util/migration/mariadb/1719776735000-newUserSettings.ts
Normal file
@ -0,0 +1,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 friend_discovery_flags integer NULL DEFAULT 0;",
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
"ALTER TABLE `user_settings` ADD view_nsfw_guilds tinyint NULL DEFAULT 1;",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
23
src/util/migration/mysql/1719776735000-newUserSettings.ts
Normal file
23
src/util/migration/mysql/1719776735000-newUserSettings.ts
Normal file
@ -0,0 +1,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 friend_discovery_flags integer NULL DEFAULT 0;",
|
||||||
|
);
|
||||||
|
await queryRunner.query(
|
||||||
|
"ALTER TABLE `user_settings` ADD view_nsfw_guilds tinyint NULL DEFAULT 1;",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
23
src/util/migration/postgres/1719776735000-newUserSettings.ts
Normal file
23
src/util/migration/postgres/1719776735000-newUserSettings.ts
Normal file
@ -0,0 +1,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 tinyint DEFAULT 1;",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user