alphagov/transition — pull request #452 by rgarner (2014-11-07 11:21:49+00:00)
Title: Remove `path_hash` everywhere but the DB

Most important thing in this (given that the tests pass) is checking over the [migration](https://github.com/alphagov/transition/blob/37ea1bef7451d5617771de9c36dec1145a94c605/db/migrate/20141104102518_add_canonical_path_to_host_paths.rb), which ended up needed a deal more work than we expected.

### DB

* Leave `hits` and `mappings` `path_hash` `NULL`able so that existing
processes are not disrupted
* Add `canonical_path` to `host_paths` to replace `c14n_path_hash`
* Populate it using the private
`HitsMappingsRelations#connect_mappings_to_host_paths`
* Move the UNIQUE `host_paths` index from `(host_id, path_hash)` to
`(host_id, path)`
* Cope with any possible rollback (including backfilling `path_hash` for `hits`
and `mappings` in the migration's `down`)

### Code

* Remap usages of `host_paths.c14n_path_hash` to
`host_paths.canonical_path`
* Replace usages of `path_hash` with appropriate plain
`*path` alternatives