add migration and update gitignore to ignore isar

This commit is contained in:
Luke McCarthy 2023-06-23 15:34:34 -04:00
parent 14df94fbb8
commit 49fae9c4cc
3 changed files with 7 additions and 2 deletions

4
mobile/.gitignore vendored
View file

@ -53,4 +53,6 @@ ios/fastlane/report.xml
# Isar
default.isar
default.isar.lock
libisar.so
libisar.so
default.isar-lck
isar.dll

View file

@ -228,7 +228,6 @@ class Asset {
bool canUpdate(Asset a) {
assert(isInDb);
assert(checksum == a.checksum);
assert(thumbhash == a.thumbhash);
assert(a.storage != AssetState.merged);
return a.updatedAt.isAfter(updatedAt) ||
a.isRemote && !isRemote ||
@ -268,6 +267,7 @@ class Asset {
livePhotoVideoId: livePhotoVideoId,
isFavorite: isFavorite,
isArchived: isArchived,
thumbhash: thumbhash,
);
}
} else {
@ -282,6 +282,7 @@ class Asset {
// isFavorite + isArchived are not set by device-only assets
isFavorite: a.isFavorite,
isArchived: a.isArchived,
thumbhash: a.thumbhash,
exifInfo: a.exifInfo?.copyWith(id: id) ?? exifInfo,
);
} else {

View file

@ -11,6 +11,8 @@ Future<void> migrateDatabaseIfNeeded(Isar db) async {
await _migrateTo(db, 2);
case 2:
await _migrateTo(db, 3);
case 3:
await _migrateTo(db, 4);
}
}