Acceptance: Fix node-ttl acceptance tests to use v2 url
Acceptance: modify hosts file to prevent dujour checkins
Acceptance: fix code for hacking /etc/hosts re: dujour
Acceptance: move /etc/host manipulation to later in the setup
Acceptance: tweak hack for determining expected schema version
Migration should fail if current version is > target

If the database schema version is _greater_ than the desired version in
the code, then migration should fail (as this situation could result in
data corruption).

Conflicts:

	test/com/puppetlabs/puppetdb/test/scf/migrate.clj
Drop the non-GIN index on catalog_resources(tags)

The non-GIN tags index is never actually used (because nobody ever does
equality comparions on ARRAY columns). That's why we added the GIN index
in the first place, because it massively sped up tag-based queries by
actually looking inside the ARRAY column for a match.

However, I wasn't smart enough to nuke the old, non-GIN index at the
same time...this patch corrects that.

This should save people some disk space and (slightly) improve catalog
storage performance. For larger installations, the space savings could
be considerable; one user reports that old index taking close to 10GB of
disk space!

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #374 from cprice-puppet/maint/master/cherry-pick-1.0.5-stuff

Maint/master/cherry pick 1.0.5 stuff
Acceptance: better method of checking target schema version

This commit adds a very simple command-line program, 'version',
which returns some data about the PuppetDB version.  Currently
it only returns the main PuppetDB version string and the target
schema version, which is useful for testing purposes.  Would like
to add some additional info (database name/version, etc.) in the
future.
Update docs to reflect that the output is no longer JSON
Add "applied-migrations" function

This commit adds a function 'applied-migrations', which returns
a list of all of the migration versions that have been applied
to the existing database.  The idea is that we will use this
to replace the "schema-version" function, so that migrations
will run *all* missing migrations in order, rather than just
checking for the latest numeric value.
Slight rework to migration logic

Prior to this commit, we determined whether or not we had outstanding
database migrations to apply by using a simple

`current_schema_version > latest_defined_schema_version`

test.  However, this made it impossible to apply bugfix schema changes
to old branches; doing so would prevent the new schema changes in the
current branch from being applied properly when the user upgraded.

This commit changes the logic so that, when determining the list of
outstanding migrations we do a set difference between all of the
defined migrations and all of the applied migrations (which we can
determine by reading from the schema_migrations table in an existing
database).  We then attempt to apply all of the pending migrations
in order.

This will allow us, in the hopefully rare cases where it is necessary,
to add a bugfix migration to an old branch as long as we:

1. Make sure that we assign it the next available integer from the
   *master* branch (which will leave a gap in the integers in the old
   branch), and
2. Make sure that the migration in question can actually be safely
   applied either before *or* after the newer migrations in the master
   branch.

For clean installs of the master branch, the change will be
last; however, for users who upgrade to a new release off of
the old branch, they'll get the single bugfix migration at that time.
When they upgrade to a release from the new branch, the missing
migrations from the new branch will be applied.
HTTP /nodes endpoint should return node status objects

Previously, /v2/nodes would return a flat list of nodes. This patchset
changes it to instead return an array of status objects (like returned
in /v1/status).

Because this unifies the notion of a "status" object and a "node"
object, we can now just ditch the dedicated `query.status` namespace as
its functionality is now subsumed in `query.node`.

We can also get rid of the `/v2/status` endpoint. It's functionality is
duplicated by `/v2/nodes/<node name>`.
Fixes based on pull request comments
A few more minor cleanup fixes
Merge pull request #375 from cprice-puppet/bug/master/migrations-across-branches

Bug/master/migrations across branches
Add more documentation about managing schema migrations
Merge pull request #378 from cprice-puppet/maint/master/update-contributing-re-migrations

Add more documentation about managing schema migrations
Additional test cases for status when doing node queries

Signed-off-by: Deepak Giridharagopal <deepak@puppetlabs.com>
Merge pull request #376 from grimradical/nodes-should-return-status

HTTP /nodes endpoint should return node status objects