alphagov/whitehall — pull request #1903 by vinayvinay (2014-12-10 10:43:48+00:00)
Title: Add id to join tables to support dependent destroy

we use `dependent: :destroy` in most places to get rid of associated records when the parent record is destroyed.

`statistics_announcement_topics` and `statistics_announcement_organisations` join tables didn't have an `id` primary key because of which we can't `dependent: :destroy` them. rails requires the `id` primary key for cascade destroys to work. going forward if we add any callback to the association objects they will get missed when a cascade destroy happens.

this change adds the `id` column to these tables to prevent that.