mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
new table in books database: book status (last access time, "percent coordinate" of current position)
This commit is contained in:
parent
8372686600
commit
811d50a4e0
1 changed files with 12 additions and 1 deletions
|
@ -70,7 +70,7 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
|
||||
private void migrate(Context context) {
|
||||
final int version = myDatabase.getVersion();
|
||||
final int currentVersion = 17;
|
||||
final int currentVersion = 18;
|
||||
if (version >= currentVersion) {
|
||||
return;
|
||||
}
|
||||
|
@ -113,6 +113,8 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
updateTables15();
|
||||
case 16:
|
||||
updateTables16();
|
||||
case 17:
|
||||
updateTables17();
|
||||
}
|
||||
myDatabase.setTransactionSuccessful();
|
||||
myDatabase.endTransaction();
|
||||
|
@ -1225,4 +1227,13 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
"ALTER TABLE Books ADD COLUMN `exists` INTEGER DEFAULT 1"
|
||||
);
|
||||
}
|
||||
|
||||
private void updateTables17() {
|
||||
myDatabase.execSQL(
|
||||
"CREATE TABLE IF NOT EXISTS BookStatus(" +
|
||||
"book_id INTEGER NOT NULL REFERENCES Books(book_id) PRIMARY KEY," +
|
||||
"access_time INTEGER NOT NULL," +
|
||||
"pages_full INTEGER NOT NULL," +
|
||||
"page_current INTEGER NOT NULL)");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue