summary refs log tree commit diff
path: root/src/util/migration/postgres
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2026-02-05 10:50:48 -0600
committerMathMan05 <mathmanrm@gmail.com>2026-02-05 10:50:48 -0600
commitc26b0f3a4c248b249cee04a68d65d1198ff7adcd (patch)
treefbf4fd5ed6c2d2c321f2ee38f75f14d3f80b0f60 /src/util/migration/postgres
parentarray init (diff)
downloadserver-ts-c26b0f3a4c248b249cee04a68d65d1198ff7adcd.tar.xz
create tags
Diffstat (limited to 'src/util/migration/postgres')
-rw-r--r--src/util/migration/postgres/1770310028511-nullableTags.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/migration/postgres/1770310028511-nullableTags.ts b/src/util/migration/postgres/1770310028511-nullableTags.ts
new file mode 100644

index 000000000..ce4b26096 --- /dev/null +++ b/src/util/migration/postgres/1770310028511-nullableTags.ts
@@ -0,0 +1,15 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class NullableTags1770310028511 implements MigrationInterface { + name = "NullableTags1770310028511"; + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "tags" ALTER COLUMN "emoji_id" DROP NOT NULL`); + await queryRunner.query(`ALTER TABLE "tags" ALTER COLUMN "emoji_name" DROP NOT NULL`); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "tags" ALTER COLUMN "emoji_name" SET NOT NULL`); + await queryRunner.query(`ALTER TABLE "tags" ALTER COLUMN "emoji_id" SET NOT NULL`); + } +}