Log db upgrade/downgrade requests

This commit is contained in:
cpfeiffer 2016-03-04 23:37:42 +01:00
parent dc162a9ac8
commit 97faf61c5a
1 changed files with 2 additions and 0 deletions

View File

@ -52,6 +52,7 @@ public class ActivityDatabaseHandler extends SQLiteOpenHelper implements DBHandl
@Override @Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
LOG.info("ActivityDatabase: schema upgrade requested from " + oldVersion + " to " + newVersion);
try { try {
for (int i = oldVersion + 1; i <= newVersion; i++) { for (int i = oldVersion + 1; i <= newVersion; i++) {
DBUpdateScript updater = getUpdateScript(db, i); DBUpdateScript updater = getUpdateScript(db, i);
@ -69,6 +70,7 @@ public class ActivityDatabaseHandler extends SQLiteOpenHelper implements DBHandl
@Override @Override
public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) {
LOG.info("ActivityDatabase: schema downgrade requested from " + oldVersion + " to " + newVersion);
try { try {
for (int i = oldVersion; i >= newVersion; i--) { for (int i = oldVersion; i >= newVersion; i--) {
DBUpdateScript updater = getUpdateScript(db, i); DBUpdateScript updater = getUpdateScript(db, i);