alphagov/whitehall — pull request #1825 by vinayvinay (2014-11-05 13:31:11+00:00)
Title: Deleting document deletes collection memberships

www.agileplannerapp.com/boards/173808/cards/8071
resolves: https://govuk.zendesk.com/tickets/866860

a document collection cannot be re-editioned if its groups contain deleted documents. if we destroy all document collection group memberships when a document is destroyed, this issue will not occur, and will also make sure references to documents are valid.

also includes a data migration to delete ~230 dangling `DocumentCollectionGroupMembership` records referring to deleted documents, which were created in absence of `dependent: delete_all`.