2024-06-15 19:36:55 +09:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: marie and other Sharkey contributors
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-11-17 23:05:58 +09:00
|
|
|
export class UpdateIndexable1700228972000 {
|
|
|
|
name = 'UpdateIndexable1700228972000'
|
|
|
|
|
|
|
|
async up(queryRunner) {
|
|
|
|
await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "isIndexable" TO "noindex"`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "noindex" SET DEFAULT false`);
|
2023-11-17 23:17:47 +09:00
|
|
|
await queryRunner.query(`UPDATE "user" SET "noindex" = NOT "noindex"`);
|
2023-11-17 23:05:58 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
async down(queryRunner) {
|
2023-11-17 23:17:47 +09:00
|
|
|
await queryRunner.query(`UPDATE "user" SET "noindex" = NOT "noindex"`);
|
2023-11-17 23:05:58 +09:00
|
|
|
await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "noindex" SET DEFAULT true`);
|
|
|
|
await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "noindex" TO "isIndexable"`);
|
|
|
|
}
|
|
|
|
}
|