swap migration order

This commit is contained in:
Rory&
2026-02-23 08:32:16 +01:00
parent f2560c1c6d
commit 785f53e7d1
@@ -9,13 +9,13 @@ export class MoreReadStateFields1771825341528 implements MigrationInterface {
await queryRunner.query(`ALTER TABLE "read_states" ADD "badge_count" integer NOT NULL DEFAULT '0'`);
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 NOT NULL`);
await queryRunner.query(`ALTER TABLE "read_states" ALTER COLUMN "mention_count" SET DEFAULT '0'`);
await queryRunner.query(`ALTER TABLE "read_states" ALTER COLUMN "mention_count" SET NOT NULL`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "read_states" ALTER COLUMN "mention_count" DROP DEFAULT`);
await queryRunner.query(`ALTER TABLE "read_states" ALTER COLUMN "mention_count" DROP NOT NULL`);
await queryRunner.query(`ALTER TABLE "read_states" ALTER COLUMN "mention_count" DROP DEFAULT`);
await queryRunner.query(`ALTER TABLE "read_states" DROP COLUMN "flags"`);
await queryRunner.query(`ALTER TABLE "read_states" DROP COLUMN "read_state_type"`);
await queryRunner.query(`ALTER TABLE "read_states" DROP COLUMN "badge_count"`);