more fixes
This commit is contained in:
@@ -64,7 +64,8 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||
),
|
||||
leftOuterJoin(
|
||||
_db.remoteAssetEntity,
|
||||
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum) &
|
||||
(_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum) |
|
||||
_db.localAssetEntity.cloudId.equalsExp(_db.remoteAssetEntity.cloudId)) &
|
||||
_db.remoteAssetEntity.ownerId.equals(userId),
|
||||
useColumns: false,
|
||||
),
|
||||
@@ -94,7 +95,8 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||
),
|
||||
innerJoin(
|
||||
_db.remoteAssetEntity,
|
||||
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum),
|
||||
_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum) |
|
||||
_db.localAssetEntity.cloudId.equalsExp(_db.remoteAssetEntity.cloudId),
|
||||
useColumns: false,
|
||||
),
|
||||
])
|
||||
@@ -116,7 +118,7 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||
final query = _db.localAssetEntity.select()
|
||||
..where(
|
||||
(lae) =>
|
||||
lae.checksum.isNotNull() &
|
||||
(lae.checksum.isNotNull() | lae.cloudId.isNotNull()) &
|
||||
existsQuery(
|
||||
_db.localAlbumAssetEntity.selectOnly()
|
||||
..addColumns([_db.localAlbumAssetEntity.assetId])
|
||||
@@ -129,7 +131,9 @@ class DriftBackupRepository extends DriftDatabaseRepository {
|
||||
_db.remoteAssetEntity.selectOnly()
|
||||
..addColumns([_db.remoteAssetEntity.checksum])
|
||||
..where(
|
||||
_db.remoteAssetEntity.checksum.equalsExp(lae.checksum) & _db.remoteAssetEntity.ownerId.equals(userId),
|
||||
(_db.localAssetEntity.checksum.equalsExp(_db.remoteAssetEntity.checksum) |
|
||||
_db.localAssetEntity.cloudId.equalsExp(_db.remoteAssetEntity.cloudId)) &
|
||||
_db.remoteAssetEntity.ownerId.equals(userId),
|
||||
),
|
||||
) &
|
||||
lae.id.isNotInQuery(_getExcludedSubquery()),
|
||||
|
||||
Reference in New Issue
Block a user