DB design document

Dave Peticolas dave@krondo.com
Wed, 20 Dec 2000 17:43:29 -0800


David Merrill writes:
> On Wed, Dec 20, 2000 at 10:21:30AM -0600, Bill Gribble wrote:
> > On Wed, Dec 20, 2000 at 09:58:25AM -0500, David Merrill wrote:
> > > So an account group can belong to another account group? The current
> > > schema doesn't provide for that. Should it? If it does, then we have
> > > account groups which can contain other account groups or accounts. the
> > > sub-groups can contain other groups or accounts. The accounts can
> > > contain other accounts.
> > 
> > Currently in gnucash, a Group (account group) has a set of Accounts.
> > An Account has a Group which contains all of its children.  So an
> > Account has exactly one Group, which itself has some set of accounts,
> > rather than an Account having several Accounts as children.
> 
> So there is no need for a parent_account_guid which allows accounts to
> have subaccounts? We only need an arbitrary number of account groups,
> each of which contains an arbitrary number of accounts?

Here's how the structure in the engine looks now:

            Group
           /  | \
          A   A  A
          |   |  |
          G   G  G
         /|\ ...

Where A is an account and G is a group. The tree alternates groups &
accounts at each level. An account contains a single group (or no group
at all) and a group contains 1 or more accounts.


> And should an account be in more than one group, or should the account
> group mechanism be strictly hierarchical?

Currently, the group mechanism enforces a single hierarchy, but we
have talked about including multiple hierarchies so that an account
could be a member of more than one hiearchy.

dave