Fix bug #4959 by correctly setting previous db version number and updating the current db version (#4960)

This commit is contained in:
Madhur Gupta 2022-05-20 13:39:45 +05:30 committed by GitHub
parent 4edabede88
commit f4414b1c31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 90 additions and 15 deletions

View file

@ -185,23 +185,17 @@ public class RecentLanguagesDao {
if (from == to) {
return;
}
if (from < 6) {
if (from < 19) {
// doesn't exist yet
from++;
onUpdate(db, from, to);
return;
}
if (from == 6) {
// table added in version 7
if (from == 19) {
// table added in version 20
onCreate(db);
from++;
onUpdate(db, from, to);
return;
}
if (from == 7) {
from++;
onUpdate(db, from, to);
return;
}
}
}