Log.d("db", "Updating transaction value stamp");
Date now = new Date();
setLongOption(MLDB.OPT_LAST_SCRAPE, now.getTime());
- Data.lastUpdateDate.set(now);
+ Data.lastUpdateDate.postValue(now);
}
public List<LedgerAccount> loadChildAccountsOf(LedgerAccount acc) {
List<LedgerAccount> result = new ArrayList<>();
return result;
}
+ public void wipeAllData() {
+ SQLiteDatabase db = MLDB.getDatabase();
+ db.beginTransaction();
+ try {
+ String[] pUuid = new String[]{uuid};
+ db.execSQL("delete from options where profile=?", pUuid);
+ db.execSQL("delete from accounts where profile=?", pUuid);
+ db.execSQL("delete from account_values where profile=?", pUuid);
+ db.execSQL("delete from transactions where profile=?", pUuid);
+ db.execSQL("delete from transaction_accounts where profile=?", pUuid);
+ db.setTransactionSuccessful();
+ }
+ finally {
+ db.endTransaction();
+ }
+ }
}