mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
sql
This commit is contained in:
parent
321f0d1ff1
commit
c285caf8bd
2 changed files with 29 additions and 17 deletions
|
|
@ -287,22 +287,20 @@ where
|
|||
|
||||
-- AssetJobRepository.getForOcr
|
||||
select
|
||||
"assets"."visibility",
|
||||
"asset"."visibility",
|
||||
(
|
||||
select
|
||||
"asset_files"."id",
|
||||
"asset_files"."path",
|
||||
"asset_files"."type"
|
||||
"asset_file"."path"
|
||||
from
|
||||
"asset_files"
|
||||
"asset_file"
|
||||
where
|
||||
"asset_files"."assetId" = "assets"."id"
|
||||
and "asset_files"."type" = $1
|
||||
"asset_file"."assetId" = "asset"."id"
|
||||
and "asset_file"."type" = $1
|
||||
) as "previewFile"
|
||||
from
|
||||
"assets"
|
||||
"asset"
|
||||
where
|
||||
"assets"."id" = $2
|
||||
"asset"."id" = $2
|
||||
|
||||
-- AssetJobRepository.getForSyncAssets
|
||||
select
|
||||
|
|
@ -504,14 +502,14 @@ order by
|
|||
|
||||
-- AssetJobRepository.streamForOcrJob
|
||||
select
|
||||
"assets"."id"
|
||||
"asset"."id"
|
||||
from
|
||||
"assets"
|
||||
inner join "asset_job_status" on "asset_job_status"."assetId" = "assets"."id"
|
||||
"asset"
|
||||
inner join "asset_job_status" on "asset_job_status"."assetId" = "asset"."id"
|
||||
where
|
||||
"asset_job_status"."ocrAt" is null
|
||||
and "assets"."deletedAt" is null
|
||||
and "assets"."visibility" != $1
|
||||
and "asset"."deletedAt" is null
|
||||
and "asset"."visibility" != $1
|
||||
|
||||
-- AssetJobRepository.streamForMigrationJob
|
||||
select
|
||||
|
|
|
|||
|
|
@ -36,16 +36,30 @@ with
|
|||
"x4",
|
||||
"y4",
|
||||
"text",
|
||||
"confidence"
|
||||
"boxScore",
|
||||
"textScore"
|
||||
)
|
||||
values
|
||||
($2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)
|
||||
(
|
||||
$2,
|
||||
$3,
|
||||
$4,
|
||||
$5,
|
||||
$6,
|
||||
$7,
|
||||
$8,
|
||||
$9,
|
||||
$10,
|
||||
$11,
|
||||
$12,
|
||||
$13
|
||||
)
|
||||
),
|
||||
"inserted_search" as (
|
||||
insert into
|
||||
"ocr_search" ("assetId", "text")
|
||||
values
|
||||
($13, $14)
|
||||
($14, $15)
|
||||
on conflict ("assetId") do update
|
||||
set
|
||||
"text" = "excluded"."text"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue