Get code and migrations working with PostgreSQL and add tests (atleast for the migrations) for PostgreSQL.