Db structure

Phil Longstaff plongstaff at rogers.com
Sun Aug 9 15:46:46 EDT 2009


For the most part, I've tried to make the db schema match the XML schema, 
including warts.  There are 2 places I'd like to change, and am looking for 
feedback:

1) Each account stores a number of boolean flags (tax-related, hidden, 
placeholder) in the slots table.  It would be simpler if these were just 
boolean values in the accounts table.

2) Each budget stores all of the budget information in slots, with path names 
of <guid>/<period> (e.g. 294ddec82b0840980d98203/12).  These should be moved 
to a new budget_values table with columns id (autoinc/primary key), 
account_guid, period_num, budget_value (numeric).  This would allow better 
access to the budget info by external tools.

Both of these proposals would involve moving the db storage for certain fields 
from slots to a more normal table structure.  In the case of the account flags, 
the xml file structure could also change to add "<hidden>true</hidden>" format.

This leads to potential backwards compatibility problems in the xml file 
format.  However, as long as 2.4 can read 2.2 XML files, do we need to keep 
backwards compatibility so that 2.2 can read 2.4 files?

Phil


More information about the gnucash-devel mailing list