Automatically clear old download log entries on upgrade (#6370)
This commit is contained in:
parent
835f007b67
commit
86c11584b5
|
@ -1477,6 +1477,9 @@ public class PodDBAdapter {
|
|||
public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) {
|
||||
Log.w("DBAdapter", "Upgrading from version " + oldVersion + " to " + newVersion + ".");
|
||||
DBUpgrader.upgrade(db, oldVersion, newVersion);
|
||||
|
||||
db.execSQL("DELETE FROM " + PodDBAdapter.TABLE_NAME_DOWNLOAD_LOG + " WHERE "
|
||||
+ PodDBAdapter.KEY_COMPLETION_DATE + "<" + (System.currentTimeMillis() - 7L * 24L * 3600L * 1000L));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue