<br><br><div><span class="gmail_quote">On 8/1/06, <b class="gmail_sendername">Anthony Gardner</b> &lt;<a href="mailto:cyclewood_ltd@yahoo.co.uk">cyclewood_ltd@yahoo.co.uk</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>I'm a newbie to ORM and DBIx::Class and I think my question will be bread and butter for you guys but I can't figure it out so don't flame me!!</div></blockquote><div><br><br>This may not completely answer your questions,&nbsp; but it might move you in the right directions:
<br><br>1) On the many to many table design:&nbsp; The &quot;school_attendees&quot; table doesn't need its own &quot;id&quot; primary key field.&nbsp; It can (and arguably *should*) be built as:<br><br></div> CREATE TABLE school_attendees
 (<br> &nbsp; attendee_id INTEGER NOT NULL REFERENCES students(id),<br> &nbsp; school_id INTEGER NOT NULL REFERENCES schools(id),<br>&nbsp; PRIMARY KEY(attendee_id, school_id)<br> );</div><br>2) In DB::MyTestSchema::School, you have the load_components arguments backwards.&nbsp; Its PK::Auto first, then Core, like you have it in the other ones (order matters).
<br><br>3) See <a href="http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#Many-to-many_relationships">http://search.cpan.org/dist/DBIx-Class/lib/DBIx/Class/Manual/Cookbook.pod#Many-to-many_relationships
</a> for example of how to construct a many-to-many relationship helper on top of the two underlying one-to-many relationships you've built.<br><br>-- Brandon<br>