title: Creating a 'many-to-many' relationship
body: <p>I have three tables: Schools (id, school_name), Schools_Focuses (id, school_id, focus_id) and Focuses (id, focus) and want to create a method on my Schools model that returns all related Focuses.</p>
  
  <p>I can perform what I want to do with this SQL QUERY: </p>
  
  <pre><code>SELECT focus FROM focuses INNER JOIN schools_focuses ON focuses.id = schools_focuses.focus_id INNER JOIN schools ON schools.id = schools_focuses.school_id WHERE schools.id = 36;
  </code></pre>
  
  <p>Model code:</p>
  
  <pre><code>// Define Models
  exports.School = School = Bookshelf.PG.Model.extend({
    tableName: 'schools',
  
    focuses: function() {
      return this.hasMany(Focus).through(Schools_Focuses);
    }
  });
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>Possibly unhandled Error: column focuses.schools_focuse_id does not exist, sql: select "focuses".*, "schools_focuses"."id" as "_pivot_id", "schools_focuses"."school_id" as "_pivot_school_id" from "focuses" inner join "schools_focuses" on "schools_focuses"."id" = "focuses"."schools_focuse_id" where "schools_focuses"."school_id" in (?)</p>
  </blockquote>
  
  <p>I don't want to have this extra column (focuses.schools_focuse_id) in Focuses because a focus can belongTo more than one school. </p>
  
  <p>How can I correctly set this up? I have played around with the foreign keys and other keys for hasMany() and through() but no luck.</p>
  
  <p>Thanks!</p>