summary refs log tree commit diff
path: root/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/migration/postgres/1721298824927-webhookMessageProperties.ts')
-rw-r--r--src/util/migration/postgres/1721298824927-webhookMessageProperties.ts17
1 files changed, 17 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 00000000..bd603f10 --- /dev/null +++ b/src/util/migration/postgres/1721298824927-webhookMessageProperties.ts
@@ -0,0 +1,17 @@ +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"); + } +}