From aade72bd485b01a988fc2911dce1e761bd4a0892 Mon Sep 17 00:00:00 2001 From: gauthier-th Date: Sat, 21 Dec 2024 19:30:31 +0100 Subject: [PATCH] fix: create PostgreSQL migration and fix SQLite migration --- .../postgres/1734805738349-AddOverrideRules.ts | 15 +++++++++++++++ .../1734805733535-AddOverrideRules.ts} | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 server/migration/postgres/1734805738349-AddOverrideRules.ts rename server/migration/{1731963944025-AddOverrideRules.ts => sqlite/1734805733535-AddOverrideRules.ts} (86%) diff --git a/server/migration/postgres/1734805738349-AddOverrideRules.ts b/server/migration/postgres/1734805738349-AddOverrideRules.ts new file mode 100644 index 000000000..b9cc4721f --- /dev/null +++ b/server/migration/postgres/1734805738349-AddOverrideRules.ts @@ -0,0 +1,15 @@ +import type { MigrationInterface, QueryRunner } from 'typeorm'; + +export class AddOverrideRules1734805738349 implements MigrationInterface { + name = 'AddOverrideRules1734805738349'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE TABLE "override_rule" ("id" SERIAL NOT NULL, "radarrServiceId" integer, "sonarrServiceId" integer, "users" character varying, "genre" character varying, "language" character varying, "keywords" character varying, "profileId" integer, "rootFolder" character varying, "tags" character varying, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_657f810c7b20a4fce45aee8f182" PRIMARY KEY ("id"))` + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP TABLE "override_rule"`); + } +} diff --git a/server/migration/1731963944025-AddOverrideRules.ts b/server/migration/sqlite/1734805733535-AddOverrideRules.ts similarity index 86% rename from server/migration/1731963944025-AddOverrideRules.ts rename to server/migration/sqlite/1734805733535-AddOverrideRules.ts index 2283e37b2..692dc8751 100644 --- a/server/migration/1731963944025-AddOverrideRules.ts +++ b/server/migration/sqlite/1734805733535-AddOverrideRules.ts @@ -1,7 +1,7 @@ import type { MigrationInterface, QueryRunner } from 'typeorm'; -export class AddOverrideRules1731963944025 implements MigrationInterface { - name = 'AddOverrideRules1731963944025'; +export class AddOverrideRules1734805733535 implements MigrationInterface { + name = 'AddOverrideRules1734805733535'; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(