From 4dccea066e78080db421fdc87c12441cf6cf6e5d Mon Sep 17 00:00:00 2001 From: hijiki Date: Sat, 26 Oct 2024 20:34:46 +0900 Subject: [PATCH] migration --- .../backend/migration/9999999999999-power.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 packages/backend/migration/9999999999999-power.js diff --git a/packages/backend/migration/9999999999999-power.js b/packages/backend/migration/9999999999999-power.js new file mode 100644 index 0000000000..13247be547 --- /dev/null +++ b/packages/backend/migration/9999999999999-power.js @@ -0,0 +1,17 @@ +export class Power9999999999999 { + name = 'Power9999999999999'; + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "isLocked" SET DEFAULT true;`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'private';`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followingVisibility" SET DEFAULT 'private';`); + await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "isExplorable" SET DEFAULT false;`); + await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "hideOnlineStatus" SET DEFAULT true;`); + } + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "isLocked" SET DEFAULT false;`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followersVisibility" SET DEFAULT 'public';`); + await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "followingVisibility" SET DEFAULT 'public';`); + await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "isExplorable" SET DEFAULT NULL;`); + await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "hideOnlineStatus" SET DEFAULT NULL;`); + } + } \ No newline at end of file