Db structure (Phil Longstaff)

Phil Longstaff plongstaff at rogers.com
Mon Aug 10 21:21:45 EDT 2009

On August 10, 2009 08:09:17 pm J. Alex Aycinena wrote:
> Phil,
> > ---------- Forwarded message ----------
> > From: Phil Longstaff <plongstaff at rogers.com>
> > To: Gnucash list <gnucash-devel at lists.gnucash.org>
> > Date: Sun, 9 Aug 2009 15:46:46 -0400
> > Subject: Db structure
> > 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.
> I'm currently doing some work to enhance the US income tax
> capabilities. This work uses account slots: tax code (not new, already
> exists), payer-name-source (not new, already exists), and copy-number
> (this is a new slot for my work). I would also like to propose to use
> some book-level slot information for 'income-tax-entity-type' and
> 'income-tax-entity-name' to add support for income taxes beyond just
> personal (e.g., corporate, partnership, etc.).
> How would your proposal affect my work in progress? By the way, I'm
> close to finishing it and submitting a patch but still need to do more
> testing.

The slots allow extra information to be added to an object by other modules.  
I'm not going to remove the slots functionality.

For the accounts, I simply propose to move the storage for the hidden and 
placeholder flags from slots to the normal table.  I did mention the tax-
related flag, but can leave that one in slots if you want.  Note that there is 
a xaccAccountGetTaxRelated() function which retrieves the flag from the slot.  
As long as your code uses xaccAccountGetTaxRelated() and 
xaccAccountSetTaxRelated(), your code would not change if the flag was moved 
from the slot to "normal" storage.

Account items stored in slots (Get/Set routines exist for all of these):
- notes string
- tax-related flag
- tax-US/code string
- tax-US/payer-name-source string
- placeholder flag - will be moved out of slot
- hidden flag - will be moved out of slot
- reconcile-info/last-date
- reconcile-info/last-interval/months and /days
- reconcile-info/postpone/date
- reconcile-info/postpone/balance
- reconcile-info/auto-interest-transfer flag
- last-num string
- reconcile-info/include-children flag


More information about the gnucash-devel mailing list