last_pinned_timestamp int4 -> timestamp

This commit is contained in:
Rory&
2026-02-25 06:17:42 +01:00
parent 0e35466f57
commit 8dc9029920
2 changed files with 17 additions and 2 deletions

View File

@@ -95,8 +95,8 @@ export class Channel extends BaseClass {
@ManyToOne(() => User)
owner: User;
@Column({ nullable: true })
last_pin_timestamp?: number;
@Column({ nullable: true, type: "timestamp with time zone" })
last_pin_timestamp?: Date | null; // ISO8601
@Column({ nullable: true })
default_auto_archive_duration?: number;

View File

@@ -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`);
}
}