summary refs log tree commit diff
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-02-25 06:13:04 +0100
committerRory& <root@rory.gay>2026-02-25 06:13:04 +0100
commit0e35466f57e5fde4a772c4c6fc812237741dac29 (patch)
treebfde55dc5200b57b81882aaa350086ab26191bec
parentFix read state type field - fixes #1559 (diff)
downloadserver-ts-0e35466f57e5fde4a772c4c6fc812237741dac29.tar.xz
Include explicit update where NULL in migration
-rw-r--r--src/util/migration/postgres/1771825341528-MoreReadStateFields.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/util/migration/postgres/1771825341528-MoreReadStateFields.ts b/src/util/migration/postgres/1771825341528-MoreReadStateFields.ts

index 30b6c3b0..13ddd6a4 100644 --- a/src/util/migration/postgres/1771825341528-MoreReadStateFields.ts +++ b/src/util/migration/postgres/1771825341528-MoreReadStateFields.ts
@@ -10,6 +10,7 @@ export class MoreReadStateFields1771825341528 implements MigrationInterface { await queryRunner.query(`ALTER TABLE "read_states" ADD "read_state_type" integer NOT NULL DEFAULT '0'`); await queryRunner.query(`ALTER TABLE "read_states" ADD "flags" integer NOT NULL DEFAULT '0'`); await queryRunner.query(`ALTER TABLE "read_states" ALTER COLUMN "mention_count" SET DEFAULT '0'`); + await queryRunner.query(`UPDATE "read_states" SET "mention_count" = 0 WHERE "mention_count" IS NULL`); await queryRunner.query(`ALTER TABLE "read_states" ALTER COLUMN "mention_count" SET NOT NULL`); }