From: Damyan Ivanov Date: Thu, 7 Mar 2019 04:59:31 +0000 (+0200) Subject: set keep=1 when inserting new accounts X-Git-Tag: v0.8~27 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=9d7700a808b96834c01f13f099f36fc0a49df74f;p=mobile-ledger.git set keep=1 when inserting new accounts --- diff --git a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java index 168941f8..ab4d7010 100644 --- a/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java +++ b/app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java @@ -187,8 +187,8 @@ public final class MobileLedgerProfile { // we like the default, but for new accounts only db.execSQL("update accounts set level = ?, keep = 1 where profile=? and name = ?", new Object[]{acc.getLevel(), uuid, acc.getName()}); - db.execSQL("insert into accounts(profile, name, name_upper, parent_name, level) " + - "select ?,?,?,?,? where (select changes() = 0)", + db.execSQL("insert into accounts(profile, name, name_upper, parent_name, level, keep) " + + "select ?,?,?,?,?,1 where (select changes() = 0)", new Object[]{uuid, acc.getName(), acc.getName().toUpperCase(), acc.getParentName(), acc.getLevel() });