[Dbix-class] more newbie questions

Dermot paikkos at googlemail.com
Thu Feb 28 10:35:59 GMT 2008


On 28/02/2008, Nigel Metheringham <nigel.metheringham at dev.intechnology.co.u=
k>
wrote:
>
>
> On 28 Feb 2008, at 09:51, Dermot wrote:
> > 1) I have been using the MySQL workbench tool to try and make a ER
> > diagram of a database. The community edition doesn't allow printing
> > but is excellent in every other way. Could anyone recommend a
> > similar tool? I hear Dia is a good OS tool.
>
>
> Given a db or DBIC description, there are some tools in
> SQL::Translator to  spit out ER diagrams.
>
>
> > 2) I posted a query about the Catalyst tutorials and that fact that
> > the used a join table to show many to many relationships between
> > authors and books. Is this type of table what is termed a view? Or
> > am I still not getting it :-(
>
>
> Not a view - those are the table like things you can produce with
> CREATE VIEW ...
>
> The problem is that you can do a many-to-one or one-to-many
> relationship by having the many item contain a foreign key to the one
> item.  However there is no such neat method to do a many-to-many
> relationship, so you have to break it down to be a pair of
> relationships - a many-to-one-to-many combination with the link table
> in the middle consisting of foreign keys to the other pair of tables.
>
> As an example, for a theatre event (as in show) handling db I have,
> each show has 0 or more ticket agencies selling tickets.  The ticket
> agencies are re-used for many events (so a place in town will sell
> tickets for many events).
>
> Hence I have an "event" table
> and a "ticket_agent" table
> and a "event_ticket_agent" table - this one purely consists of 2
> fields - the event id and the ticket_agent id, and links the pair.
>
> I refer to that as a link table, but I am a sysadmin rather than a DB
> expert :-)
>
> Hope that helps a bit.
>
>         Nigel.
>

That does Nigel thanx. In the DB I am trying to design I can see lots of 1:M
relationships but I can't see a case for using a join table. That's leading
to me thinking that I am doing something wrong.

MySQL workbench doesn't appear to be on sale retail yet. Having used it I
would like to have a copy of the standard edition. I'm off to cpan the as
per Peter post and check out SQL::Translator.

Thanx again.
Dp.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080228/dd4=
df86d/attachment-0001.htm


More information about the DBIx-Class mailing list