upd: completely change handling of indexable
This commit is contained in:
parent
902e5a81f9
commit
55ef4c4d93
12 changed files with 40 additions and 25 deletions
15
packages/backend/migration/1700228972000-update-indexable.js
Normal file
15
packages/backend/migration/1700228972000-update-indexable.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
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`);
|
||||
await queryRunner.query(`UPDATE "user" SET "noindex" = false WHERE "noindex" = true`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`UPDATE "user" SET "noindex" = true WHERE "noindex" = false`);
|
||||
await queryRunner.query(`ALTER TABLE "user" ALTER COLUMN "noindex" SET DEFAULT true`);
|
||||
await queryRunner.query(`ALTER TABLE "user" RENAME COLUMN "noindex" TO "isIndexable"`);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue