1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 18:29:23 +02:00

new table in books database: book status (last access time, "percent coordinate" of current position)

This commit is contained in:
Nikolay Pultsin 2011-11-06 18:18:58 +00:00
parent 8372686600
commit 811d50a4e0

View file

@ -70,7 +70,7 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
private void migrate(Context context) { private void migrate(Context context) {
final int version = myDatabase.getVersion(); final int version = myDatabase.getVersion();
final int currentVersion = 17; final int currentVersion = 18;
if (version >= currentVersion) { if (version >= currentVersion) {
return; return;
} }
@ -113,6 +113,8 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
updateTables15(); updateTables15();
case 16: case 16:
updateTables16(); updateTables16();
case 17:
updateTables17();
} }
myDatabase.setTransactionSuccessful(); myDatabase.setTransactionSuccessful();
myDatabase.endTransaction(); myDatabase.endTransaction();
@ -1225,4 +1227,13 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
"ALTER TABLE Books ADD COLUMN `exists` INTEGER DEFAULT 1" "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)");
}
} }