refactor(server): non-nullable file metadata (#17598)

This commit is contained in:
Mert 2025-04-15 07:03:31 -04:00 committed by GitHub
parent bd92748ddd
commit c3d10c5be2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 49 additions and 66 deletions

View file

@ -71,6 +71,3 @@ where
and "activity"."albumId" = $2
and "activity"."isLiked" = $3
and "assets"."deletedAt" is null
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null

View file

@ -171,9 +171,6 @@ where
"ownerId" = $1::uuid
and "deviceId" = $2
and "isVisible" = $3
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null
and "deletedAt" is null
-- AssetRepository.getLivePhotoCount
@ -334,9 +331,6 @@ with
where
"assets"."deletedAt" is null
and "assets"."isVisible" = $2
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null
)
select
"timeBucket",
@ -490,9 +484,6 @@ from
where
"assets"."ownerId" = $1::uuid
and "assets"."isVisible" = $2
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null
and "assets"."updatedAt" <= $3
and "assets"."id" > $4
order by
@ -523,9 +514,6 @@ from
where
"assets"."ownerId" = any ($1::uuid[])
and "assets"."isVisible" = $2
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null
and "assets"."updatedAt" > $3
limit
$4

View file

@ -13,9 +13,6 @@ where
and "assets"."isFavorite" = $4
and "assets"."isArchived" = $5
and "assets"."deletedAt" is null
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null
order by
"assets"."fileCreatedAt" desc
limit
@ -37,9 +34,6 @@ offset
and "assets"."isFavorite" = $4
and "assets"."isArchived" = $5
and "assets"."deletedAt" is null
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null
and "assets"."id" < $6
order by
random()
@ -60,9 +54,6 @@ union all
and "assets"."isFavorite" = $11
and "assets"."isArchived" = $12
and "assets"."deletedAt" is null
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null
and "assets"."id" > $13
order by
random()
@ -86,9 +77,6 @@ where
and "assets"."isFavorite" = $4
and "assets"."isArchived" = $5
and "assets"."deletedAt" is null
and "assets"."fileCreatedAt" is not null
and "assets"."fileModifiedAt" is not null
and "assets"."localDateTime" is not null
order by
smart_search.embedding <=> $6
limit