From 9d7700a808b96834c01f13f099f36fc0a49df74f Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 7 Mar 2019 06:59:31 +0200 Subject: [PATCH] set keep=1 when inserting new accounts --- .../java/net/ktnx/mobileledger/model/MobileLedgerProfile.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() }); -- 2.39.5