1👍
Sure you are on the right way. The continuous integration is the way to go for testing your code before send it to production. Heroku did a great work with its buildpacks, but its not a good environment to testing things that are not “usual” on web development.
About your problem on PostGIS on heroku, look this comment from Heroku documentation:
PostGIS is available in public beta. The beta is available on all
Production tier databases and currently supports PostGIS version 2.0.
It is not available on the Dev or Basic Hobby tier plans. PostGIS is
only available with Postgres 9.2 databases provisioned after April 20,
2013 and all Postgres 9.3 database. To enable PostGIS once connected
to your PostgreSQL 9.2 database run:
CREATE EXTENSION postgis;
Make sure you are not using a version above 2.0 and not running on a development or basic database environment.
Again, IMHO you should do this on the circle-ci continuous integration environment and then push the resulting artifacts to Heroku.