Multiple nullable foreign keys in one table
<p>I am in the process of designing a table for a promotion. I can promote three types of entities: article, photo and forum thread. </p>

<p>Initially I thought about creating one table with three foreign keys where only one would be set.</p>

<pre><code>promotion: 
- id
- id_article
- id_photo
- id_thread
- promotion_type
- ... other properties

 article:
 - id
 - .. other properties

 photo:
 - id
 - .. other properties

 thread:
 - id
 - .. other properties
</code></pre>

<p>Is t a good approach? After initial thoughts it does look like there could be something "prettier" done here. <code>promotion_type</code> indicates which foreign keys tables should be joined. </p>