summary refs log tree commit diff
path: root/src/util/migration/postgres
diff options
context:
space:
mode:
authorCyber <mateusz.hf18@gmail.com>2024-07-10 20:03:30 +0200
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2024-07-17 19:55:29 +1000
commit01ca7b77360c1ead0961815b2c73bbe091c3e06e (patch)
treee345470ace1a598ea079478a8daeb1e58afe5ee3 /src/util/migration/postgres
parentSupport apng & webm (diff)
downloadserver-ts-01ca7b77360c1ead0961815b2c73bbe091c3e06e.tar.xz
feat: badges
Diffstat (limited to 'src/util/migration/postgres')
-rw-r--r--src/util/migration/postgres/1720628601997-badges.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/migration/postgres/1720628601997-badges.ts b/src/util/migration/postgres/1720628601997-badges.ts
new file mode 100644

index 00000000..f7b9958b --- /dev/null +++ b/src/util/migration/postgres/1720628601997-badges.ts
@@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class Badges1720628601997 implements MigrationInterface { + name = "Badges1720628601997"; + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query( + `CREATE TABLE "badges" ("id" character varying NOT NULL, "description" character varying NOT NULL, "icon" character varying NOT NULL, "link" character varying, CONSTRAINT "PK_8a651318b8de577e8e217676466" PRIMARY KEY ("id"))`, + ); + await queryRunner.query(`ALTER TABLE "users" ADD "badge_ids" text`); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "users" DROP COLUMN "badge_ids"`); + } +}