alphagov/whitehall — pull request #1162 by tekin (2013-12-16 15:25:35+00:00)
Title: Duplicate attachment filename data fix

Tracker: https://www.pivotaltracker.com/story/show/62558398

The data migration required to deliver (https://www.pivotaltracker.com/story/show/62252064).

The migration renames and replaces attachment files that share a filename on a given attachable model. This is done using the "replaced_by" mechanism on the AttachmentData model so that requests to the old attachment files are automatically redirected. Attachments are renamed and replaced on the following models:

* Published editions
* Consultation responses
* Policy advisory groups
* Corporate information pages

Published editions are re-editioned and published as a minor change with a editorial remark indicating what happened. If a newer draft is present, then the edition is skipped and these editions will need to be manually fixed.