Re: Relationship question.

[prev] [thread] [next] [Date index for 2005/06/14]

From: Rod Za
Subject: Re: Relationship question.
Date: 16:25 on 14 Jun 2005
Thank you guys,

I would like to receive some "sorts of conseils" to design a database relationship to easely use
with the Class::DBI. 

For example: 

i got 4 databases tables (see below): users, groups, relationship and history.

- The user can got more than one group and the relationship table guard the relation user/groups;
- the history guard the user's activities;

What is the "best way" (easely way) to make this relationship to work with the Class::DBI? 
(how to make the relationship history/user, history/group, history/user&group)

<---DB tables--->
+------------+
| USER       |
+------------+
|*id_user    |---+     +----------------+  
| login      |   |     | relationship   |
|  ...       |   |     +----------------+
+------------+   +----<|*id_user        |
                 +----<|*id_group       |
+------------+   |     +----------------+
| GROUP      |   |
+------------+   |
|*id_group   |---+
| group_name |
|  ....      |
+------------+

+------------+
| HISTORY    |
+------------+
| id_history |
| id_user    |
| id_group   |
|   ...      |
+------------+
</--DB tables-->

thank you again.

Rodrigo.





--- Aaron Trevena <aaron.trevena@xxxxx.xxx> wrote:

> On 6/14/05, Matt S Trout <cdbi-talk@xxxxx.xx.xx> wrote:
> > On Mon, Jun 13, 2005 at 11:15:30AM -0700, Rod Za wrote:
> > > I just like to know if someone can put me in the right direction to make a many2many
> relationship
> > > using the Class::DBI.
> > >
> > > My question is there are a CPAN Module to do this without pain?
> > 
> > http://trout.me.uk/perl/
> > 
> > You can try the code on there.
> > 
> > Somebody also posted some other code that does something similar.
> 
> Yes, there is a Class::DBI::HasManyOrdered module wot I wrote
>
(http://search.cpan.org/~teejay/Class-DBI-Relationship-HasManyOrdered-0.02/lib/Class/DBI/Relationship/HasManyOrdered.pm)
> 
> I was planning to do a more general HasManyWithSuperPowers based on
> that but haven't had the free time.
>  
> > I'm going to write a proper HasManyToMany relationship using the new
> > join-on-search features of Class::DBI::Sweet (0.01 on CPAN, 0.02 currently
> > in development, snapshots available from
> > http://dev.catalyst.perl.org/snapshots/Catalyst/)
> 
> Cool. Matt do you want to let me know what your goals are for the
> module and how you plan the API to work as it's probably worth
> collaborating on an enhanced HasMany module rather than a hodgepodge
> of different ones - one module is easier to test, support, etc than a
> couple.
> 
> Cheers,
> 
> A.
> 



		
__________________________________ 
Discover Yahoo! 
Find restaurants, movies, travel and more fun for the weekend. Check it out! 
http://discover.yahoo.com/weekend.html 

(message missing)

Trivial Question
David Christensen 01:36 on 11 Jun 2005

Re: Trivial Question
Cees Hek 01:56 on 11 Jun 2005

Re: Trivial Question
David Christensen 12:58 on 11 Jun 2005

Re: Trivial Question
Tony Bowden 07:30 on 11 Jun 2005

Re: Trivial Question
Michael G Schwern 20:32 on 11 Jun 2005

Re: Trivial Question
Tony Bowden 21:49 on 11 Jun 2005

Re: Trivial Question
Michael G Schwern 00:15 on 12 Jun 2005

Re: Trivial Question
Emanuele Zeppieri 08:27 on 12 Jun 2005

Relationship question.
Rod Za 18:15 on 13 Jun 2005

Re: Relationship question.
Matt S Trout 02:07 on 14 Jun 2005

Re: Relationship question.
Aaron Trevena 08:41 on 14 Jun 2005

Re: Relationship question.
Rod Za 16:25 on 14 Jun 2005

Generated at 16:37 on 28 Jul 2005 by mariachi v0.52