J
John Delano
Can anyone give me some advice on designing a table structure that can
represent joint accounts in a donor/donation database for a small college?
The database currently has over 50-60 tables and is far more complex than
this, but essentially, there is currently one Account table with fields like
FirstName, LastName, etc. and there is a Ledger table that records all the
individual gifts and is related to the Account table in a 1-M relationship.
For unmarried accounts, this works perfectly fine. Things seem to break down
when we attempt to use this structure for two accounts that are married (and
we do need to keep track of both husband and wife, because they may both be
alumni of our college). I want to be able to represent donations as coming
from either husband and wife as if they were from both accounts. In other
words, when I open the wife's account screen, I want to be able to see her
husband's donations as well as her own and vice-versa.
Things get complicated when you factor in the possibility of a spouse dying
and/or the couple getting a divorce and then remarrying. For example, to
which spouse are the gifts attributed after the divorce?
I'm currently handling this through a M-M recursive relationship on the
Account table. The problem is that this is pretty slow, and because of
difficult to enforce program logic, there can end up being multiple marriage
relationships assigned to the same person (albeit accidentally).
Am I even approaching this correctly? Would a separate 1-1 recursive
relationship work any better?
Any ideas/hints would be appreciated.
represent joint accounts in a donor/donation database for a small college?
The database currently has over 50-60 tables and is far more complex than
this, but essentially, there is currently one Account table with fields like
FirstName, LastName, etc. and there is a Ledger table that records all the
individual gifts and is related to the Account table in a 1-M relationship.
For unmarried accounts, this works perfectly fine. Things seem to break down
when we attempt to use this structure for two accounts that are married (and
we do need to keep track of both husband and wife, because they may both be
alumni of our college). I want to be able to represent donations as coming
from either husband and wife as if they were from both accounts. In other
words, when I open the wife's account screen, I want to be able to see her
husband's donations as well as her own and vice-versa.
Things get complicated when you factor in the possibility of a spouse dying
and/or the couple getting a divorce and then remarrying. For example, to
which spouse are the gifts attributed after the divorce?
I'm currently handling this through a M-M recursive relationship on the
Account table. The problem is that this is pretty slow, and because of
difficult to enforce program logic, there can end up being multiple marriage
relationships assigned to the same person (albeit accidentally).
Am I even approaching this correctly? Would a separate 1-1 recursive
relationship work any better?
Any ideas/hints would be appreciated.