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
|
-- AssetJobRepository.getForOcr
|
||||||
select
|
select
|
||||||
"assets"."visibility",
|
"asset"."visibility",
|
||||||
(
|
(
|
||||||
select
|
select
|
||||||
"asset_files"."id",
|
"asset_file"."path"
|
||||||
"asset_files"."path",
|
|
||||||
"asset_files"."type"
|
|
||||||
from
|
from
|
||||||
"asset_files"
|
"asset_file"
|
||||||
where
|
where
|
||||||
"asset_files"."assetId" = "assets"."id"
|
"asset_file"."assetId" = "asset"."id"
|
||||||
and "asset_files"."type" = $1
|
and "asset_file"."type" = $1
|
||||||
) as "previewFile"
|
) as "previewFile"
|
||||||
from
|
from
|
||||||
"assets"
|
"asset"
|
||||||
where
|
where
|
||||||
"assets"."id" = $2
|
"asset"."id" = $2
|
||||||
|
|
||||||
-- AssetJobRepository.getForSyncAssets
|
-- AssetJobRepository.getForSyncAssets
|
||||||
select
|
select
|
||||||
|
|
@ -504,14 +502,14 @@ order by
|
||||||
|
|
||||||
-- AssetJobRepository.streamForOcrJob
|
-- AssetJobRepository.streamForOcrJob
|
||||||
select
|
select
|
||||||
"assets"."id"
|
"asset"."id"
|
||||||
from
|
from
|
||||||
"assets"
|
"asset"
|
||||||
inner join "asset_job_status" on "asset_job_status"."assetId" = "assets"."id"
|
inner join "asset_job_status" on "asset_job_status"."assetId" = "asset"."id"
|
||||||
where
|
where
|
||||||
"asset_job_status"."ocrAt" is null
|
"asset_job_status"."ocrAt" is null
|
||||||
and "assets"."deletedAt" is null
|
and "asset"."deletedAt" is null
|
||||||
and "assets"."visibility" != $1
|
and "asset"."visibility" != $1
|
||||||
|
|
||||||
-- AssetJobRepository.streamForMigrationJob
|
-- AssetJobRepository.streamForMigrationJob
|
||||||
select
|
select
|
||||||
|
|
|
||||||
|
|
@ -36,16 +36,30 @@ with
|
||||||
"x4",
|
"x4",
|
||||||
"y4",
|
"y4",
|
||||||
"text",
|
"text",
|
||||||
"confidence"
|
"boxScore",
|
||||||
|
"textScore"
|
||||||
)
|
)
|
||||||
values
|
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 (
|
"inserted_search" as (
|
||||||
insert into
|
insert into
|
||||||
"ocr_search" ("assetId", "text")
|
"ocr_search" ("assetId", "text")
|
||||||
values
|
values
|
||||||
($13, $14)
|
($14, $15)
|
||||||
on conflict ("assetId") do update
|
on conflict ("assetId") do update
|
||||||
set
|
set
|
||||||
"text" = "excluded"."text"
|
"text" = "excluded"."text"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue