summary refs log tree commit diff
path: root/src/util/migration/postgres
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-02-25 06:17:42 +0100
committerRory& <root@rory.gay>2026-02-25 06:25:28 +0100
commit8dc9029920752ecfcf433687c7e4a2fda772eb4a (patch)
tree1573085ac88915ef39011ebb9dd55c1a6e9e908d /src/util/migration/postgres
parentInclude explicit update where NULL in migration (diff)
downloadserver-ts-8dc9029920752ecfcf433687c7e4a2fda772eb4a.tar.xz
last_pinned_timestamp int4 -> timestamp
Diffstat (limited to 'src/util/migration/postgres')
-rw-r--r--src/util/migration/postgres/1771997061671-LastPinTimestampAsDate.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/migration/postgres/1771997061671-LastPinTimestampAsDate.ts b/src/util/migration/postgres/1771997061671-LastPinTimestampAsDate.ts
new file mode 100644

index 000000000..a5aaf4749 --- /dev/null +++ b/src/util/migration/postgres/1771997061671-LastPinTimestampAsDate.ts
@@ -0,0 +1,15 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class LastPinTimestampAsDate1771997061671 implements MigrationInterface { + name = "LastPinTimestampAsDate1771997061671"; + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "channels" DROP COLUMN "last_pin_timestamp"`); + await queryRunner.query(`ALTER TABLE "channels" ADD "last_pin_timestamp" TIMESTAMP WITH TIME ZONE`); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "channels" DROP COLUMN "last_pin_timestamp"`); + await queryRunner.query(`ALTER TABLE "channels" ADD "last_pin_timestamp" integer`); + } +}