May 12, 2013
At Heroku we use Travis CI to run project tests on push to GitHub. While Travis CI offers PostgreSQL in their environment, it’s version 9.1. A project I’m working on recently started using PostgreSQL 9.2’s JSON data type, which 9.1 does not have.
Needing 9.2, I searched for ways to make it available in the Travis CI environment. I found guides that suggested upgrading PostgreSQL in a before_script
but I didn’t have much luck with that approach. Plus, it would add time to each build which I was hoping to avoid. I knew Heroku Postgres offered 9.2 by default, what I really wanted was a fresh Heroku Postgres database for every test run.