public async Task UpdateDatabaseAsync() {
Version databaseVersion = VersionAccess.GetVersionInfo();
if (databaseVersion < new Version(1, 3, 2, 0)) {
if (isDatabaseRecreated)
throw new Exception(string.Format("InitialDatabase version {0} is outdated.", databaseVersion.ToString()));
string Msg = string.Format("Database v{0} is outdated. Do you wish to delete it and recreate an updated database? All your personal data will be lost.", databaseVersion.ToString(3));
if (MessageBox.Show(owner, Msg, "Database Update", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
throw new Exception(string.Format("Database is outdated."));
GC.Collect();
await TryUntilTimeout(() => FileOperationAPIWrapper.MoveToRecycleBin(Settings.DatabasePath), 10000);
isDatabaseRecreated = true;
await EnsureAvailableAsync();
// UpdateDatabaseToVersion(backupBeforeUpdate, 0, 9, 3, 0);
}
}