With the following in my .travis.yml
:
addons:
postgresql: "9.3"
before_script:
- psql --version
- psql -c 'SELECT version();' -U postgres
I get the following output:
$ psql --version
$ psql (PostgreSQL) 9.4.0
$ psql -c 'SELECT version();' -U postgres
PostgreSQL 9.1.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit
Obviously there's something wrong here but I'm not sure how to tell Travis to actually use the postgres version I specified. I followed the instructions in Travis Docs. This seems like a bug.
This is an issue because I'm using the new json
column type and therefore getting the following error:
PG::UndefinedObject: ERROR: type "json" does not exist
I took a look and what you're encountering is essentially a bug in how our YAML parsing handles duplicate keys. Fixing how we handle this is something we're working.
You have two addons:
keys in your .travis.yml
files
What happens is that the last key wins and your postgres stuff is silently discarded.
If you combine them like the following, it will work as desired.
addons:
postgres: "9.3"
code_climate:
repo_token: 75408d377a0b3c1ab512bf3fb634617bccf2a1065f8c513e352139427ec8e1fb
See https://github.com/solarce/orientation/commit/8dd4c1c10b8470ff3529af1d6591d619f211354d and https://travis-ci.org/solarce/orientation/jobs/83220170 for an example of this
Please feel free to also reach out to [email protected] if you have any other questions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With