summary refs log tree commit diff
path: root/src/util/migration/postgres
diff options
context:
space:
mode:
authorTomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>2024-07-18 12:42:07 +0200
committerTomatoCake <60300461+DEVTomatoCake@users.noreply.github.com>2024-07-18 12:42:07 +0200
commite7a98b6c46e3d4fdaa68bd8a04ffcf53a9dac184 (patch)
tree5c1b8e91c8f8c3915193694f1ae27d91bb2565f6 /src/util/migration/postgres
parentStart implementing webhooks (diff)
downloadserver-ts-e7a98b6c46e3d4fdaa68bd8a04ffcf53a9dac184.tar.xz
webhook fixes & username/avatar property for msg
Diffstat (limited to 'src/util/migration/postgres')
-rw-r--r--src/util/migration/postgres/1721298824927-webhookMessageProperties.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts b/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts
new file mode 100644

index 000000000..46c507d43 --- /dev/null +++ b/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts
@@ -0,0 +1,15 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class WebhookMessageProperties1721298824927 implements MigrationInterface { + name = "WebhookMessageProperties1721298824927"; + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query("ALTER TABLE messages ADD username text NULL"); + await queryRunner.query("ALTER TABLE messages ADD avatar text NULL"); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query("ALTER TABLE messages DROP COLUMN username"); + await queryRunner.query("ALTER TABLE messages DROP COLUMN avatar"); + } +}