summary refs log tree commit diff
path: root/src/database/migration/postgres/1721298824927-webhookMessageProperties.ts
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2026-06-11 23:18:02 +0200
committerRory& <root@rory.gay>2026-06-12 17:58:18 +0200
commit83e60464ad2675f09ddee02f6b166bef22f53f33 (patch)
tree9e12033c00c8420166f52c397b461cad288277fe /src/database/migration/postgres/1721298824927-webhookMessageProperties.ts
parentFix recursive import in database (diff)
downloadserver-ts-83e60464ad2675f09ddee02f6b166bef22f53f33.tar.xz
Move migrations to database
Diffstat (limited to 'src/database/migration/postgres/1721298824927-webhookMessageProperties.ts')
-rw-r--r--src/database/migration/postgres/1721298824927-webhookMessageProperties.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/database/migration/postgres/1721298824927-webhookMessageProperties.ts b/src/database/migration/postgres/1721298824927-webhookMessageProperties.ts
new file mode 100644

index 00000000..3576e4ac --- /dev/null +++ b/src/database/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"); + } +}