How to use postgres extensions on Heroku? And how to handle their migrations?

蹲街弑〆低调 提交于 2019-12-06 05:12:17

问题


I have a Rails app that includes pg_search and queue_classic gems. Both of these make use of PostgreSQL extensions e.g., unaccent, pg_trgm and ps-something-something (sorry, not as my dev machine and can not remember).

I'm deploying to Heroku, and having trouble running my migrations that exceute these extensions

e.g.,

def up
  execute "create extension unaccent"
  execute "create extension pg_trgm"
end

I get the impression that Heroku supports these from here https://devcenter.heroku.com/articles/full-text-search and the fact that Heroku uses queue_classic https://github.com/ryandotsmith/queue_classic.

I've been unable to find any information that explains how to make use of these postgres extensions on Heroku. Or even if they are available for shared databases or only dedicated.

So my questions:

  1. How to I make these extensions available to my app on Heroku?
  2. How do I handle migrations so that these extensions are available to dev and test environments, but don't break migrations on staging or production or environments if Heroku is restricting this type of execution.

Really appreciate any ideas, especially those accompanied with pointers to relevant information/ instructions.

Thanks


回答1:


If you're using the old standard shared database plans then these probably won't work so you need to look at bumping up to the new shared plans or the production plans.



来源:https://stackoverflow.com/questions/10648774/how-to-use-postgres-extensions-on-heroku-and-how-to-handle-their-migrations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!