On Wednesday, August 21, 2013 8:05:10 AM UTC-7, Adam Gamble wrote: > > Hi all, > > Just looking for some opinions on the following scenario, not very > experience with database design.. I have two tables (A, B) that both > require a comments column that would relate to a comments table (C). > > Presently it seems like I want two different comment tables (C.A, C.B) to > create the `one_to_many` `many_to_one` relationships in the Models. I do, > however, sometimes need to aggregate all comments.. is there a way to > implement this association in Sequel? >
Well, it really depends on your needs. You can use separate tables, but then aggregation requires doing it in the application or using a UNION in SQL. You can always use a single comments table that both A and B reference, but this would allow rows from both A and B to reference the same comment. To provide more help you'd probably have to be more specific, by posting your proposed schema and exactly what types of associations you want. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/groups/opt_out.
