|
|
|
|
@ -29,7 +29,7 @@ import 'package:isar/isar.dart';
|
|
|
|
|
// ignore: import_rule_photo_manager
|
|
|
|
|
import 'package:photo_manager/photo_manager.dart';
|
|
|
|
|
|
|
|
|
|
const int targetVersion = 17;
|
|
|
|
|
const int targetVersion = 18;
|
|
|
|
|
|
|
|
|
|
Future<void> migrateDatabaseIfNeeded(Isar db, Drift drift) async {
|
|
|
|
|
final hasVersion = Store.tryGet(StoreKey.version) != null;
|
|
|
|
|
@ -63,7 +63,8 @@ Future<void> migrateDatabaseIfNeeded(Isar db, Drift drift) async {
|
|
|
|
|
await Store.populateCache();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await handleBetaMigration(version, await _isNewInstallation(db, drift), SyncStreamRepository(drift));
|
|
|
|
|
final syncStreamRepository = SyncStreamRepository(drift);
|
|
|
|
|
await handleBetaMigration(version, await _isNewInstallation(db, drift), syncStreamRepository);
|
|
|
|
|
|
|
|
|
|
if (version < 17 && Store.isBetaTimelineEnabled) {
|
|
|
|
|
final delay = Store.get(StoreKey.backupTriggerDelay, AppSettingsEnum.backupTriggerDelay.defaultValue);
|
|
|
|
|
@ -72,6 +73,11 @@ Future<void> migrateDatabaseIfNeeded(Isar db, Drift drift) async {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (version < 18 && Store.isBetaTimelineEnabled) {
|
|
|
|
|
await syncStreamRepository.reset();
|
|
|
|
|
await Store.put(StoreKey.shouldResetSync, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (targetVersion >= 12) {
|
|
|
|
|
await Store.put(StoreKey.version, targetVersion);
|
|
|
|
|
return;
|
|
|
|
|
|