【发布时间】:2014-01-14 10:17:22
【问题描述】:
我一直在尝试将我的数据库迁移到 HSTORE,但当我想在其他架构中添加 HSTORE 列时,该扩展仅适用于 public SCHEMA,但它不起作用
def up
# My hstore looks like this
execute "CREATE EXTENSION hstore SCHEMA public"
# I have also tried
# execute "CREATE EXTENSION hstore"
end
但是当我运行下一次迁移时,它就不起作用了,如果我去 psql 控制台并更改表,我会得到:
set search_path to public;
alter table accounts add column extras hstore; -- Works fine
set search_path to schema2;
alter table accounts add column extras hstore; -- Raises an error
我正在使用 Rails 4 谢谢。
【问题讨论】:
标签: ruby-on-rails postgresql ruby-on-rails-4 hstore