title: Sequelize association where one of the models varies
body: <p>Let's say I have three models: <code>Bucket</code> <code>Water</code> and <code>Sand</code>. A <code>Bucket</code> can have an association with <code>Water</code> or <code>Sand</code> but not both. So in theory, my relationship definitions would look like this:</p>
  <pre><code>Bucket.hasOne(Water, { as: 'contents' })
  Water.belongsTo(Bucket)
  
  Bucket.hasOne(Sand, { as: 'contents' })
  Sand.belongsTo(Bucket)
  </code></pre>
  <p>This should create a foreign key column on the Water and Sand tables referencing a bucket. And then, in theory, if I query Bucket.getContents() I'll get either the water or the sand object.</p>
  <p>Is this legit? I couldn't find any examples of an association like this in the docs. Is there a better way to do it?</p>
  <p>Although this is a contrived example, the reason for <code>Water</code> and <code>Sand</code> being different models is they each have a lot of columns that are unique to their model, so it makes sense to keep them separate than try to make one combined model.</p>