mirror of
https://github.com/immich-app/immich.git
synced 2024-12-28 22:51:59 +00:00
9503bf479b
* feat(mobile): album view sort order * feat: add error message * refactor(mobile): album page (#14659) * refactor album page * update lint rule * const record * fix: updating sort order when pull to refresh --------- Co-authored-by: Alex <alex.tran1502@gmail.com> * Move sort toggle button to bottom sheet menu * chore: revert multiselectgrid loading status * chore: revert multiselectgrid loading status --------- Co-authored-by: Mert <101130780+mertalev@users.noreply.github.com>
19 lines
510 B
Dart
19 lines
510 B
Dart
import 'dart:async';
|
|
|
|
import 'package:immich_mobile/entities/store.entity.dart';
|
|
import 'package:immich_mobile/utils/db.dart';
|
|
import 'package:isar/isar.dart';
|
|
|
|
const int targetVersion = 8;
|
|
|
|
Future<void> migrateDatabaseIfNeeded(Isar db) async {
|
|
final int version = Store.get(StoreKey.version, 1);
|
|
if (version < targetVersion) {
|
|
_migrateTo(db, targetVersion);
|
|
}
|
|
}
|
|
|
|
Future<void> _migrateTo(Isar db, int version) async {
|
|
await clearAssetsAndAlbums(db);
|
|
await Store.put(StoreKey.version, version);
|
|
}
|