use new column entry instead

This commit is contained in:
timonrieger 2026-04-23 08:39:58 +02:00
parent cdd47f3b10
commit 7a0d8ecaad
No known key found for this signature in database
2 changed files with 22 additions and 2 deletions

View File

@ -395,6 +395,26 @@ export const columns = {
'asset.height',
'asset.isEdited',
],
syncPartnerAsset: [
'asset.id',
'asset.ownerId',
'asset.originalFileName',
'asset.thumbhash',
'asset.checksum',
'asset.fileCreatedAt',
'asset.fileModifiedAt',
'asset.localDateTime',
'asset.type',
'asset.deletedAt',
'asset.visibility',
'asset.duration',
'asset.livePhotoVideoId',
'asset.stackId',
'asset.libraryId',
'asset.width',
'asset.height',
'asset.isEdited',
],
syncAlbumUser: ['album_user.albumId as albumId', 'album_user.userId as userId', 'album_user.role'],
syncStack: ['stack.id', 'stack.createdAt', 'stack.updatedAt', 'stack.primaryAssetId', 'stack.ownerId'],
syncUser: ['id', 'name', 'email', 'avatarColor', 'deletedAt', 'updateId', 'profileImagePath', 'profileChangedAt'],

View File

@ -595,7 +595,7 @@ class PartnerAssetsSync extends BaseSync {
@GenerateSql({ params: [dummyBackfillOptions, DummyValue.UUID], stream: true })
getBackfill(options: SyncBackfillOptions, partnerId: string) {
return this.backfillQuery('asset', options)
.select(columns.syncAsset.filter((c) => c !== 'asset.isFavorite') as ReadonlyArray<(typeof columns.syncAsset)[number]>)
.select(columns.syncPartnerAsset)
.select(sql<boolean>`false`.as('isFavorite'))
.select('asset.updateId')
.where('ownerId', '=', partnerId)
@ -615,7 +615,7 @@ class PartnerAssetsSync extends BaseSync {
@GenerateSql({ params: [dummyQueryOptions], stream: true })
getUpserts(options: SyncQueryOptions) {
return this.upsertQuery('asset', options)
.select(columns.syncAsset.filter((c) => c !== 'asset.isFavorite') as ReadonlyArray<(typeof columns.syncAsset)[number]>)
.select(columns.syncPartnerAsset)
.select(sql<boolean>`false`.as('isFavorite'))
.select('asset.updateId')
.where('ownerId', 'in', (eb) =>