On Feb 22, 2008, at 9:20 AM, Dermot wrote:

What happens if you extend the schema so that you included, say editors. Would you create a new join table or have add a field to the join table.
Thanx,
Dp.

Maybe but I'd be inclined to make "author" into a "person" table and add another table for contributing roles. The same person can be listed as an author and an editor for a work; two tables means you end up with duplicate records for the same person in editor and author. If you want to join arbitrary persons to a work, just make a "persons" table and a table designating their contributing role in in the work. Look for ways to generalize or abstract the specifics you find yourself naturally inclined to attach to a record. If you find yourself duplicating information in a database, you're probably doing something wrong.

table contributing_role
  person (fk to person.id)
  work (fk to book.id, or movie.id, or recording.id…?)
  role "Editor"
  desc …


-Ashley


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to