alphagov/content-store — pull request #96 by heathd (2014-12-19 12:26:44+00:00)
Title: Remove redirects for non-case study content items

We noticed a bug triggered by the following repro steps:

1. unpublish a document in whitehall with redirect
2. republish it

EXPECT: to see the newly republished item
ACTUAL: still get a redirect

The unpublishing sends a redirect to content store which registers the
redirect with the router.

When we re-publish a whitehall document we send a place holder format to
content store but the redirect is not removed from router api.

Therefore the redirect is in force and even though the document could be
rendered by whitehall, the router does not allow requests for it to pass
through.

This adds a data migration to remove unpublishings and redirects from
the content store, other than for CaseStudies.

Related story card for background:
https://trello.com/c/FW0Ly34Y/99-bug-republishing-an-unpublished-document-still-redirects