silent11 has asked for the wisdom of the Perl Monks concerning the following question:
After spending about an hour attempting to figure out why Class::DBI was croaking on a package that was defining a table with 2 foreign keys I realized that multiple foreign keys in one table isn't supported by Class::DBI.
Well, that's fine -- I'm just giving CDBI a test run, and I'm glad I found this little quirk out early in my usage with it.
In this test application (a bookmarks/links app) I had 3 tables, `users`, `category`, and `links`. The link table contained the columns `id`,`category_id`,`user_id`,`url`,etc...
My question is, why are multiple foreign keys such an evil thing? And what would be a better way to design this schema?
Update:Okay, I got it working, despite the problme I *thought* I had. reading this helped me out.
-silent11
Spread Firefox
Well, that's fine -- I'm just giving CDBI a test run, and I'm glad I found this little quirk out early in my usage with it.
In this test application (a bookmarks/links app) I had 3 tables, `users`, `category`, and `links`. The link table contained the columns `id`,`category_id`,`user_id`,`url`,etc...
My question is, why are multiple foreign keys such an evil thing? And what would be a better way to design this schema?
Update:Okay, I got it working, despite the problme I *thought* I had. reading this helped me out.
-silent11
Spread Firefox
Janitored by Arunbear - moved from Meditations to SOPW. Also removed 'OT?' prefix from title.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Class::DBI and multiple foreign keys
by perrin (Chancellor) on May 31, 2005 at 01:58 UTC | |
by merlyn (Sage) on May 31, 2005 at 12:11 UTC | |
Re: Class::DBI and multiple foreign keys
by monarch (Priest) on May 31, 2005 at 04:42 UTC | |
by PodMaster (Abbot) on May 31, 2005 at 05:40 UTC |
Back to
Seekers of Perl Wisdom