title: Elixir Ecto - Association with 3 or more tables
body: <p>if I have <code>profile</code>, <code>item</code>, <code>location</code> table which:</p>
  <ul>
  <li><code>profile</code> has many <code>location</code>.</li>
  <li><code>item</code> has one <code>location</code>.</li>
  <li><code>location</code> in <code>profile</code> and <code>item</code> will NOT overlap.</li>
  </ul>
  <p>How should I design the <code>location</code> table?
  Is below valid?  <code>location</code> belongs to 2 tables?</p>
  <pre><code>schema &quot;profiles&quot; do
  ...
  has_many :location, Location
  end
  
  schema &quot;items&quot; do
  ...
  has_one :location, Location
  end
  
  schema &quot;locations&quot; do
  ...
  belongs_to :profile, Profile
  belongs_to :item, Item
  end
  </code></pre>
  <p>or should there be 2 <code>location</code> tables?</p>