Schema
David Merrill
dmerrill@lupercalia.net
Tue, 12 Dec 2000 16:03:03 -0500
On Wed, Dec 13, 2000 at 06:42:04AM +1000, Phillip J Shelton wrote:
> David Merrill wrote:
>
> > I'm beginning to work on the database schema for an eventual SQL back
> > end. I am keeping my notes in an ASCII file, which will always be
> > available at http://www.lupercalia.net/schema.txt
>
> some comments and suggestions.
>
> > SPLIT
> > -----
> > account_guid char 32 ->account.account_guid
> > transaction_guid char 21
> > ->transaction.transaction_guid
> > ^
> > Aren't GUIDs 32 bytes?
>
> Um, could you explain GUIDs? I am lost.
Globally Unique ID, also known as UUID or Universal Unique ID. It is a
32 byte value usually calculated using the machine's MAC address and
the time, plus some random stuff, plus more stuff I don't understand.
It is guaranteed to be unique.
The specification on UUIDs is available from The Open Group at
http://www.opennc.org/onlinepubs/9629399/apdxa.htm
> > split_guid char 32
> > action ???
> > memo varchar any notes the user
> > enters
> > reconciled char 1 Y/N
> > damount money does this mean debit
> > amount?
>
> It is the smallest amount that this account can change by. GnuCash is
> now using a variation on rational numbers which have a numerator, the
> value, and a denominator, the damont.
So 'd' stands for denominator. Okay, thanks.
But then why is it in the SPLIT table?
>
> > value money ???
> > date_reconciled.tv_sec ???
> > date_reconciled.tv_nsec ???
> > balance money ??? balance when, of
> > what?
> > cleared_balance money "
> > reconciled_balance money "
> > share_balance money "
> > share_cleared_balance money "
> > share_reconciled_balance money "
>
> Are not these balance's more correctly part of the account?
Good question. I copied this structure from the C code, which may not
have the same logic as the db when it comes to running totals. I
*think* these values are here because running totals were being kept
right with the transaction/split. Can someone say right/wrong//what-an-idiot
on this?
Also regarding running totals, how many actual balances are kept in
this fashion? The official balance, obviously, but also cleared?
reconciled?
> > kvp_data ???
> >
> >
> >
> > TRANSACTION
> > -----------
> > transaction_guid char 32
> > transaction_date date date of event
>
> These need a note field as well.
>
> A transaction is the unit that is entered in the ledger, and the splits
> are for which accounts are affected by the transaction. Others will
> have a better explanation I am sure.
So the note field is equivalent to "memo" in your register? There is
already a memo field in the SPLIT table. Isn't it redundant to have it
here?
--
Dr. David C. Merrill http://www.lupercalia.net
Linux Documentation Project dmerrill@lupercalia.net
Collection Editor & Coordinator http://www.linuxdoc.org
Finger me for my public key
Androphobia:
Fear of men.