Fix bug #4949 by correctly setting previous db version number (#4956)

* Fix bug #4949 by correctly setting previous db version number

* Fix failing tests
This commit is contained in:
Madhur Gupta 2022-05-18 22:17:10 +05:30 committed by GitHub
parent 9880d7ea7e
commit 4edabede88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 79 additions and 8 deletions

View file

@ -309,22 +309,18 @@ public class BookmarkItemsDao {
if (from == to) {
return;
}
if (from < 7) {
if (from < 18) {
// doesn't exist yet
from++;
onUpdate(db, from, to);
return;
}
if (from == 7) {
if (from == 18) {
// table added in version 19
onCreate(db);
from++;
onUpdate(db, from, to);
return;
}
if (from == 8) {
from++;
onUpdate(db, from, to);
}
}
}