[Dbix-class] Newbie - database structure

Dermot paikkos at googlemail.com
Fri Feb 22 17:20:55 GMT 2008


On 22/02/2008, Wade.Stuart at fallon.com <Wade.Stuart at fallon.com> wrote:
>
> "Zbigniew Lukasiak" <zzbbyy at gmail.com> wrote on 02/22/2008 09:38:07 AM:
>
> To really beat it in Dermot, you seem to be mistaking the "best practice"
> for 1:N (has many) with what we are talking about here: N:N (many to many)
> where each side of the relation can have bi- directional links to 0->N
> items.
>
> Table Author
> ID  Author
> 0   Wade
> 1   Zbigniew
> 2   Dermot
>
> Join table:
> Author   Book
> 0       0
> 0       1
> 0        2
> 1        0
> 1        2
> 2        1
>
>
> Book table:
> ID   Book
> 0    foo
> 1    bar
> 2    bas
>
>
> There are ways (and some reasons to do so for optimization) to do this
> without a join table,  but 99 times out of 100 this is the best bet.
>
>
Okay truly pulverised.

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080222/583=
db061/attachment-0001.htm


More information about the DBIx-Class mailing list