Fix some Postgres-incompatible migration code
Fix some Postgres-incompatible migration code

Postgres doesn't have a DATETIME column type, so use TIMESTAMP instead.  This
also requires a bit of munging to turn our Date instance into a suitable
Timestamp format.

Also wrap schema-version in its own transaction, because selecting against the
schema_migrations table can fail (which is correct, before the table exists),
which causes future create table statements to be ignored.

cprice404/puppetdb,nfagerlund/puppetdb,senior/puppetdb,nfagerlund/puppetdb,github/puppetlabs-puppetdb,kbrezina/puppetdb,senior/puppetdb,github/puppetlabs-puppetdb,mullr/puppetdb,johnduarte/puppetdb,mullr/puppetdb,grimradical/puppetdb,johnduarte/puppetdb,wkalt/puppetdb,cprice404/puppetdb,melissa/puppetdb,mullr/puppetdb,ajroetker/puppetdb,highb/puppetdb,highb/puppetdb,grimradical/puppetdb,puppetlabs/puppetdb,rbrw/puppetdb,jantman/puppetdb,mullr/puppetdb,waynr/puppetdb,kbrezina/puppetdb,wkalt/puppetdb,stahnma/puppetdb,shrug/puppetdb,grimradical/puppetdb,senior/puppetdb,senior/puppetdb,puppetlabs/puppetdb,ajroetker/puppetdb,melissa/puppetdb,shrug/puppetdb,wkalt/puppetdb,rbrw/puppetdb,highb/puppetdb,ajroetker/puppetdb,nfagerlund/puppetdb,grimradical/puppetdb,kbarber/puppetdb,kbarber/puppetdb,puppetlabs/puppetdb,johnduarte/puppetdb,johnduarte/puppetdb,shrug/puppetdb,rbrw/puppetdb,stahnma/puppetdb,stahnma/puppetdb,highb/puppetdb,haus/puppetdb,kbarber/puppetdb,ajroetker/puppetdb,melissa/puppetdb,kbarber/puppetdb,waynr/puppetdb,puppetlabs/puppetdb,jantman/puppetdb,cprice404/puppetdb,wkalt/puppetdb,shrug/puppetdb,rbrw/puppetdb,waynr/puppetdb,mullr/puppetdb,jantman/puppetdb,kbrezina/puppetdb,haus/puppetdb,github/puppetlabs-puppetdb,haus/puppetdb,puppetlabs/puppetdb,rbrw/puppetdb,kbrezina/puppetdb,waynr/puppetdb