Thanks for the good advice and discussion. So, taking your advice, actually brings it all back to the original question. I believe I understand what you are recommending. So I created a fk_user_picture_id in the picture table which identifies the owner through the user_picture table.
To me that is a has_one relationship between picture and user through the user_picture table, which is actually the root question that started this discussion. Now that my database is in order, does anyone have any documentation or tips on how to implement this.. I am not finding documentation and all my attempts haven't seemed to work. -Steve Matt S Trout wrote: > On Tue, Jun 26, 2007 at 04:30:26PM -0700, Marc Mims wrote: > >> * Steve Francia <[EMAIL PROTECTED]> [070626 16:00]: >> >>> Sadly, that is the way we had it, we decided to switch to using the >>> owner flag to try to eliminate duplication of data in the database. >>> >> At least in the problem you presented, I don't see the data duplication >> problem with a foreign key to the user table in the picture table. The >> key itself would exist in both the picture table and the user_picture >> table, but I think that is a natural consequence of the relationships. >> > > Actually, I'd probably have the owner_id be part of a compound FK to > user_picture rather than user - enforces that that link exists ... > > -- Steve Francia Lead Developer Takkle, Inc. 212.792.5859 (fax) [EMAIL PROTECTED]
_______________________________________________ List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class Wiki: http://dbix-class.shadowcatsystems.co.uk/ IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/ Searchable Archive: http://www.mail-archive.com/[email protected]/
