heroku issues with sql statements