High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
fix(server): handle startup reindexing after failed model change (#18688)
Mert4794a1a09244
diff --git a/server/src/repositories/database.repository.ts b/server/src/repositories/database.repository.tsindex 48e530c807..1aff2d1a1e 100644--- a/server/src/repositories/database.repository.ts+++ b/server/src/repositories/database.repository.ts@@ -247,7 +247,10 @@ export class DatabaseRepository {return;}const dimSize = await this.getDimensionSize(table);- await sql`DROP INDEX IF EXISTS ${sql.raw(indexName)}`.execute(this.db);+ await this.db.schema.dropIndex(indexName).ifExists().execute();+ if (table === 'smart_search') {+ await this.db.schema.alterTable(table).dropConstraint('dim_size_constraint').ifExists().execute();+ }await this.db.transaction().execute(async (tx) => {if (!rows.some((row) => row.columnName === 'embedding')) {this.logger.warn(`Column 'embedding' does not exist in table '${table}', truncating and adding column.`);