From 9662b587e3bdbcb4d5571e9bf7949bfc3b1fa135 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Mon, 29 Sep 2025 07:50:46 +0200 Subject: [PATCH] fix: update `pinned` column value in down migration --- src/util/migration/postgres/1752383879533-message_pinned_at.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util/migration/postgres/1752383879533-message_pinned_at.ts b/src/util/migration/postgres/1752383879533-message_pinned_at.ts index 9736f55a..2e294aad 100644 --- a/src/util/migration/postgres/1752383879533-message_pinned_at.ts +++ b/src/util/migration/postgres/1752383879533-message_pinned_at.ts @@ -18,5 +18,8 @@ export class MessagePinnedAt1752383879533 implements MigrationInterface { `ALTER TABLE "messages" DROP COLUMN "pinned_at"`, ); await queryRunner.query(`ALTER TABLE "messages" ADD "pinned" boolean`); + await queryRunner.query( + `UPDATE "messages" SET "pinned" = true WHERE "pinned_at" IS NOT NULL`, + ); } }