High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(server): unset prewarm dim parameter (#19271)
Mertf99c6feac54f
diff --git a/server/src/repositories/database.repository.ts b/server/src/repositories/database.repository.tsindex d5f94fe13d..8d9141f182 100644--- a/server/src/repositories/database.repository.ts+++ b/server/src/repositories/database.repository.ts@@ -119,8 +119,6 @@ export class DatabaseRepository {await sql`CREATE EXTENSION IF NOT EXISTS ${sql.raw(extension)} CASCADE`.execute(this.db);if (extension === DatabaseExtension.VECTORCHORD) {const dbName = sql.id(await this.getDatabaseName());- await sql`ALTER DATABASE ${dbName} SET vchordrq.prewarm_dim = '512,640,768,1024,1152,1536'`.execute(this.db);- await sql`SET vchordrq.prewarm_dim = '512,640,768,1024,1152,1536'`.execute(this.db);await sql`ALTER DATABASE ${dbName} SET vchordrq.probes = 1`.execute(this.db);await sql`SET vchordrq.probes = 1`.execute(this.db);}diff --git a/server/src/schema/migrations/1750323941566-UnsetPrewarmDimParameter.ts b/server/src/schema/migrations/1750323941566-UnsetPrewarmDimParameter.tsnew file mode 100644index 0000000000..ffad855964--- /dev/null+++ b/server/src/schema/migrations/1750323941566-UnsetPrewarmDimParameter.ts@@ -0,0 +1,15 @@+import { Kysely, sql } from 'kysely';++export async function up(db: Kysely<any>): Promise<void> {+ const { rows } = await sql<{ db: string }>`SELECT current_database() as db;`.execute(db);+ const databaseName = rows[0].db;+ await sql.raw(`ALTER DATABASE "${databaseName}" RESET vchordrq.prewarm_dim;`).execute(db);+}++export async function down(db: Kysely<any>): Promise<void> {+ const { rows } = await sql<{ db: string }>`SELECT current_database() as db;`.execute(db);+ const databaseName = rows[0].db;+ await sql+ .raw(`ALTER DATABASE "${databaseName}" SET vchordrq.prewarm_dim = '512,640,768,1024,1152,1536';`)+ .execute(db);+}