Fix image_locations column used in where clause but not joined

This commit is contained in:
Ming Ming 2023-12-10 16:27:48 +08:00
parent 10b263834d
commit 77d8791eb8

View file

@ -118,10 +118,11 @@ class FilesQueryBuilder {
if (_queryMode == FilesQueryMode.completeFile) ...[
leftOuterJoin(
db.images, db.images.accountFile.equalsExp(db.accountFiles.rowId)),
leftOuterJoin(db.imageLocations,
db.imageLocations.accountFile.equalsExp(db.accountFiles.rowId)),
leftOuterJoin(db.trashes, db.trashes.file.equalsExp(db.files.rowId)),
],
if (_queryMode == FilesQueryMode.completeFile || _byLocation != null)
leftOuterJoin(db.imageLocations,
db.imageLocations.accountFile.equalsExp(db.accountFiles.rowId)),
]) as JoinedSelectStatement;
if (_queryMode == FilesQueryMode.expression) {
query.addColumns(_selectExpressions!);