On Wed, Oct 19, 2011 at 5:50 AM, Rich Shepard <[email protected]> wrote: > On Wed, 19 Oct 2011, Armaghan Saqib wrote: > >> acc_trans.trans_id is foreign key indeed. There was no primary key on >> acc_trans table. One was added by Chris 'entry_id' in LSMB 1.2. I added >> similar one in Ledger123 schema changes. > > Armaghan, > > Thanks for making the change. > >> CASCADE UPDATE OR DELETE is not there on any primary/foreign key and it >> would work from the parent table only (ar, ap,gl). > > I'd have to think about this. Off the top of my head, if an ar entry is > deleted, the acc_trans row(s) should also be deleted or they're left > orphaned. Yet, if I correctly read Chris' message, the acc_trans key is the > union of the PKs of three separate tables. Is that correct, or is the > acc_trans key linked to only a single row in ap, or ar, or gl? Perhaps > that's the reason for my misunderstanding.
You are right Rich. Due to many reasons, referential integrity in SQL-Ledger (and Ledger123) is maintained by the application and not by database. So if you delete any parent rows (from ar,ap,gl) directly from database, respective rows are not deleted from acc_trans. (So be very careful when doing this) > The more I use and learn about the original SL the more grateful I am for > folks like you, Chris, and the others who are making the application more > robust since it's mission critical for those of us who use it. Thanks Regards Armaghan _______________________________________________ SQL-Ledger mailing list [email protected] http://lists.ledger123.com/mailman/listinfo/sql-ledger
