]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/model/MobileLedgerProfile.java
more debug (disabled)
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / model / MobileLedgerProfile.java
index 168941f87fb4ed39b165d91f96edbd711d7de133..ec204d9a47272042ba3b15b5815fb0e9aba7eeaa 100644 (file)
@@ -187,11 +187,12 @@ 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()
                 });
+//        Log.d("accounts", String.format("Stored account '%s' in DB [%s]", acc.getName(), uuid));
     }
     public void storeAccountValue(SQLiteDatabase db, String name, String currency, Float amount) {
         db.execSQL("replace into account_values(profile, account, " +