如何在Heroku上使用postgres扩展?以及如何处理他们的迁移? [英] How to use postgres extensions on Heroku? And how to handle their migrations?

查看:170
本文介绍了如何在Heroku上使用postgres扩展?以及如何处理他们的迁移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含pg_search和queue_classic gems的Rails应用程序。这两个都使用PostgreSQL扩展,例如unaccent,pg_trgm和ps-something-something(抱歉,不是我的开发机器,也不记得)。

m部署到Heroku,并且无法运行我的迁移,而这些扩展超出这些扩展名。例如,





$ b

def up
执行create extension unaccent
执行create extension pg_trgm
end

我得到Heroku支持这些的印象 https://devcenter.heroku.com/articles/full-text-search 和Heroku使用queue_classic的事实 https://github.com/ryandotsmith/queue_classic



我一直无法找到解释如何使用这些信息的任何信息Heroku上的postgres扩展。或者即使它们可用于共享数据库或仅用于专用。

b
  • 如何让这些扩展程序可用于Heroku上的应用程序?

  • 如何处理迁移,以便这些扩展可用于开发
    和测试环境,但如果Heroku不会中断迁移或
    生产或环境限制这种类型的
    执行。

  • 真的很感谢任何想法,尤其是那些伴随着相关信息/指令指针的想法。

    谢谢

    解决方案

    如果您使用旧标准共享数据库计划,那么这些可能无法正常工作,因此您需要查看新的共享计划制作计划


    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

    解决方案

    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.

    这篇关于如何在Heroku上使用postgres扩展?以及如何处理他们的迁移?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆