Remove out-of-date database.travis.yml

We aren't using either Travis or MySQL any more.
Merge pull request #476 from alphagov/remove_travis_db_config

Remove out-of-date database.travis.yml
Remove out-of-date .travis.yml

Again, we aren't using either Travis or MySQL any more.
Merge pull request #477 from alphagov/remove_travis_config

Remove out-of-date .travis.yml
Stop truncating ex-MyISAM tables in tests

We were doing this on MySQL because the hits tables were using MyISAM,
which doesn't support transactions (which are the default strategy for
database_cleaner). There shouldn't be any reason to do this on PostgreSQL,
so let's stop.

For some tests which have a lot of setup, we have been using testing_before_all
to indicate that their test data should be cleaned up only once at
the end, and with truncation, to speed up test runs. This commit assumes that:

- that's still a good thing to do for those cases;
- we have always been consistent about using truncate_everything
  for only MyISAM reasons, and testing_before_all for tests with lots
  of data.
Merge pull request #478 from alphagov/stop_truncating_everything

Stop truncating ex-MyISAM tables in tests
Update mySQL-centric comment

* There's still a use for truncate_everything, it just has nothing to do
  with myISAM
* It's now for tests that use transactions and avoiding
  PG::InFailedSqlTransaction
Add precompute_all_hits_views to sites

* Allows us to indicate which sites are considered 'large'
* We'll precompute their All Hits view for those sites
Postgres helpers for materialized views

* Let us do Postgres-y things around views in a Ruby-ish way
* We can create them, check existence, get bodies for or refresh
  them
Materialized views rake task

* For any site where precompute_all_hits_view is true, precompute a view
  that only serves all hits, all-time
* Create if one doesn't exist, refresh if it does
Materialized views quote names correctly

* Allows us to handle odd characters in the view name
  (such as those caused by our own factories)
HitsController can use an all hits, all-time view

* Where the site says it's available via `Site#able_to_use_view?`
* Will previously have been computed as a materialized view by
  `Transition::Import::MaterializedView::Hits`
Replace materialized views rather than refreshing

Slightly slower, but simpler from a deployment point of view to have only one
task that updates the code of the view as well as the view results in one
transaction. If we didn't do this we'd need some kind of "recreate" task as well
as refresh, only to be run when view code had changed.
Clarify materialized view name/purpose in spec

 * Name should reflect why it's there and what we use it for
Change Postgres::Relation.exist? to .exists?

 * Reads better in production code
 * RSpec's BuiltIn::Exist matcher will try both anyway, so no need for
   `should exists`
Add import:hits:precompute:enable/disable

* Sets/unsets the flag that will allow precomputation of an all
  hits/all-time materialized view for a list of sites
Drop views we don't need any more

* If we set Site#precompute_all_hits_views false from true, drop the
  view (if it exists)
* Also be more consistent about where view names are quoted
  (in `Postgres::MaterializedView` and the `SELECT`s, not
   `Site#precomputed_view_name`)
Refresh materialized views twice a day

* Why twice? Because it's relatively cheap and I don't like the thought
  of all hits, all-time being increasingly inaccurate as the day goes on
  (especially if traffic spikes are likely)
Show admins whether hits/all-time is precomputed

* For larger sites, let admins know at the bottom of the config
  section if a site has precomputed its all hits/all-time view