Store path relative to Rails.root when tracking hits files

We use timestamped directories for releases in production. This
means that on every deploy the absolute filenames for hits files
change, even if the hits files in transition-stats and pre-transition-stats
haven't changed. All hits files are therefore re-imported after every
deploy, which is unnecessary and takes a long time.

To fix this, this stores the filename relative to Rails.root, thereby
excluding the part of the path which changes on deploy. @rgarner thought
he had a reason for not doing this originally, but can't remember it now.

It would be good to avoid this in production, but in preview it is
even more important at the moment. Preview is deployed to more frequently
than production, and the overnight data sync from production also
causes timestamp mismatches. We're trying to compare performance of
the hits import between MySQL and Postgres at the moment, and that
is very hard when the import mostly takes much longer than it needs to,
and longer than it would be in production.
Delete absolute filename ImportedHitsFiles

Each actual hits file will have many records in this table because the
filenames were being stored as absolute paths, including a timestamped
directory per deploy. This cleans those old records up so that we will
have only one row per real hits file with a relative path filename.

This will delete only rows with an absolute filename, in case someone
wants to rollback in dev and then migrate forwards through this again
without losing any relative-filename tracking.
Add third GDS TLD IP address
Merge pull request #399 from rjc123/patch-3

Add third GDS TLD IP address
Merge pull request #398 from alphagov/store_relative_filename_for_tracking_hits

Store relative filename for tracking hits
MappingsController index can render a CSV
Link to mappings CSV export, for admins only

We don't want to encourage use of spreadsheets, but we do occasionally get
asked to provide them. Let's make life easy on ourselves by giving us a means
to provide the spreadsheet easily. It also enables advanced users to search and
filter in ways we don't intend to support (eg look for mappings matching a
regex).
Only allow admins to export as CSV
Merge pull request #392 from alphagov/mappings_csv_export

Mappings CSV export
Convert config/migrations to PostgreSQL

* Remove structure.sql, add schema.rb, configure appropriately
* Remove mySQL-specific option values from migrations
* Remove fix_collation_woes, as is all mySQL-specific
* Remove mysql2 gem in favour of pg
Explicit TNA timestamp conversion

* mySQL used to implicitly convert this
* We aren't in Kansas any more
Use correct type for http_status

* mySQL would handle this implicitly
* Postgres doesn't, thank $DEITY
Fix list ordering in host/mapping_controller specs

* Used to work by coincidence in mySQL
* We're only interested in the set, not the order
Site#default_host depends on host insert order

* Make that explicit, we got away with it in mySQL
Get everything failing for a reason

* Raise RuntimeErrors with suggestions so we can see what
  class of problem breaks what in specs
* Gives us something to fix. Ignoring features right now,
  concentrating on specs
Postgres: fix organisation sites scope

* Digit boolean becomes boolean literal
* Can't alias the COUNT in the HAVING
* ONE, ah ha ha
* TWO, ah ha ha
Fix hits update

* Add upsert support that was missing from the spike
Fix the import of DailyHitTotal

* Split upsert into two queries
* Be specific about the behaviour the specs are testing
Fix sort by hits

* Postgres requires NULLS LAST on an ORDER DESC, apparently
* We can get away with the GROUP BY primary key trick for the rest
Fix HitsMappingsRelations import

* Straight mySQL -> postgreSQL swap
* INSERT IGNORE simulation and ANSI update style