Re: Relationship question.
[prev]
[thread]
[next]
[Date index for 2005/06/14]
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)
|