|
|
@ -110,6 +110,7 @@ public abstract class DB extends RoomDatabase {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void init(@NonNull DatabaseConfiguration configuration) {
|
|
|
|
public void init(@NonNull DatabaseConfiguration configuration) {
|
|
|
|
// https://www.sqlite.org/pragma.html#pragma_wal_autocheckpoint
|
|
|
|
// https://www.sqlite.org/pragma.html#pragma_wal_autocheckpoint
|
|
|
|
|
|
|
|
if (BuildConfig.DEBUG) {
|
|
|
|
File dbfile = configuration.context.getDatabasePath(DB_NAME);
|
|
|
|
File dbfile = configuration.context.getDatabasePath(DB_NAME);
|
|
|
|
if (dbfile.exists()) {
|
|
|
|
if (dbfile.exists()) {
|
|
|
|
try (SQLiteDatabase db = SQLiteDatabase.openDatabase(dbfile.getPath(), null, SQLiteDatabase.OPEN_READWRITE)) {
|
|
|
|
try (SQLiteDatabase db = SQLiteDatabase.openDatabase(dbfile.getPath(), null, SQLiteDatabase.OPEN_READWRITE)) {
|
|
|
@ -119,6 +120,7 @@ public abstract class DB extends RoomDatabase {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
super.init(configuration);
|
|
|
|
super.init(configuration);
|
|
|
|
}
|
|
|
|
}
|
|
|
|