summary refs log tree commit diff
path: root/src/util/migration/postgres
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-07-11 12:55:38 +0200
committerRory& <root@rory.gay>2025-09-29 18:38:06 +0200
commit5e3080d72fe5a388c53698c732b855b98ca92d6e (patch)
tree0679da9d3fde39fe2f178d00ea57c24a4a21f8dd /src/util/migration/postgres
parentNest query times for clarity (diff)
downloadserver-ts-5e3080d72fe5a388c53698c732b855b98ca92d6e.tar.xz
Setting protos support
Diffstat (limited to 'src/util/migration/postgres')
-rw-r--r--src/util/migration/postgres/1752157979333-UserSettingsProtos.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util/migration/postgres/1752157979333-UserSettingsProtos.ts b/src/util/migration/postgres/1752157979333-UserSettingsProtos.ts
new file mode 100644

index 000000000..0633e144d --- /dev/null +++ b/src/util/migration/postgres/1752157979333-UserSettingsProtos.ts
@@ -0,0 +1,17 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UserSettingsProtos1752157979333 implements MigrationInterface { + name = 'UserSettingsProtos1752157979333' + + public async up(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`DROP TABLE IF EXISTS "user_settings_protos"`); + await queryRunner.query(`CREATE TABLE "user_settings_protos" ("user_id" character varying NOT NULL, "userSettings" text, "frecencySettings" text, CONSTRAINT "PK_8ff3d1961a48b693810c9f99853" PRIMARY KEY ("user_id"))`); + await queryRunner.query(`ALTER TABLE "user_settings_protos" ADD CONSTRAINT "FK_8ff3d1961a48b693810c9f99853" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); + } + + public async down(queryRunner: QueryRunner): Promise<void> { + await queryRunner.query(`ALTER TABLE "user_settings_protos" DROP CONSTRAINT "FK_8ff3d1961a48b693810c9f99853"`); + await queryRunner.query(`DROP TABLE "user_settings_protos"`); + } + +}