mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
fix: repeat timeline migration for first time user (#21794)
This commit is contained in:
parent
56e5236a39
commit
2d2673c114
4 changed files with 63 additions and 52 deletions
|
|
@ -63,7 +63,10 @@ Future<void> migrateDatabaseIfNeeded(Isar db, Drift drift) async {
|
|||
|
||||
// Handle migration only for this version
|
||||
// TODO: remove when old timeline is removed
|
||||
if (version == 15) {
|
||||
final needBetaMigration = Store.tryGet(StoreKey.needBetaMigration);
|
||||
if (version == 15 && needBetaMigration == null) {
|
||||
// Check both databases directly instead of relying on cache
|
||||
|
||||
final isBeta = Store.tryGet(StoreKey.betaTimeline);
|
||||
final isNewInstallation = await _isNewInstallation(db, drift);
|
||||
|
||||
|
|
@ -71,6 +74,7 @@ Future<void> migrateDatabaseIfNeeded(Isar db, Drift drift) async {
|
|||
// For existing installations, only migrate if beta timeline is not enabled (null or false)
|
||||
if (isNewInstallation || isBeta == true) {
|
||||
await Store.put(StoreKey.needBetaMigration, false);
|
||||
await Store.put(StoreKey.betaTimeline, true);
|
||||
} else {
|
||||
await resetDriftDatabase(drift);
|
||||
await Store.put(StoreKey.needBetaMigration, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue