mirror of
https://github.com/immich-app/immich.git
synced 2025-06-22 06:50:54 -04:00
revert refreshfaces sql change
This commit is contained in:
parent
34f72a8251
commit
32f25580ec
@ -222,6 +222,21 @@ where
|
|||||||
"person"."ownerId" = $3
|
"person"."ownerId" = $3
|
||||||
and "asset_faces"."deletedAt" is null
|
and "asset_faces"."deletedAt" is null
|
||||||
|
|
||||||
|
-- PersonRepository.refreshFaces
|
||||||
|
with
|
||||||
|
"added_embeddings" as (
|
||||||
|
insert into
|
||||||
|
"face_search" ("faceId", "embedding")
|
||||||
|
values
|
||||||
|
($1, $2)
|
||||||
|
)
|
||||||
|
select
|
||||||
|
from
|
||||||
|
(
|
||||||
|
select
|
||||||
|
1
|
||||||
|
) as "dummy"
|
||||||
|
|
||||||
-- PersonRepository.getFacesByIds
|
-- PersonRepository.getFacesByIds
|
||||||
select
|
select
|
||||||
"asset_faces".*,
|
"asset_faces".*,
|
||||||
|
@ -115,10 +115,10 @@ export class DatabaseRepository {
|
|||||||
async createExtension(extension: DatabaseExtension): Promise<void> {
|
async createExtension(extension: DatabaseExtension): Promise<void> {
|
||||||
await sql`CREATE EXTENSION IF NOT EXISTS ${sql.raw(extension)} CASCADE`.execute(this.db);
|
await sql`CREATE EXTENSION IF NOT EXISTS ${sql.raw(extension)} CASCADE`.execute(this.db);
|
||||||
if (extension === DatabaseExtension.VECTORCHORD) {
|
if (extension === DatabaseExtension.VECTORCHORD) {
|
||||||
const db = await this.getDatabaseName();
|
const dbName = sql.table(await this.getDatabaseName());
|
||||||
await sql`ALTER DATABASE ${sql.table(db)} SET vchordrq.prewarm_dim = '512,640,768,1024,1152,1536'`.execute(this.db);
|
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`SET vchordrq.prewarm_dim = '512,640,768,1024,1152,1536'`.execute(this.db);
|
||||||
await sql`ALTER DATABASE ${sql.table(db)} SET vchordrq.probes = 1`.execute(this.db);
|
await sql`ALTER DATABASE ${dbName} SET vchordrq.probes = 1`.execute(this.db);
|
||||||
await sql`SET vchordrq.probes = 1`.execute(this.db);
|
await sql`SET vchordrq.probes = 1`.execute(this.db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,6 +400,7 @@ export class PersonRepository {
|
|||||||
return results.map(({ id }) => id);
|
return results.map(({ id }) => id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GenerateSql({ params: [[], [], [{ faceId: DummyValue.UUID, embedding: DummyValue.VECTOR }]] })
|
||||||
async refreshFaces(
|
async refreshFaces(
|
||||||
facesToAdd: (Insertable<AssetFaces> & { assetId: string })[],
|
facesToAdd: (Insertable<AssetFaces> & { assetId: string })[],
|
||||||
faceIdsToRemove: string[],
|
faceIdsToRemove: string[],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user