开发者

How do I configure a heroku app's database that uses postgresql using the schema?

I've been using mysql forever. never really needed anything fancier. But I'm using heroku a lot and while I'm working, I like free search, so I'm using the acts_as_tsearch plugin. If you go to the git repository, it tells you:

* Preparing your PostgreSQL database

Add a text search configuration 'default':

  CREATE TEXT SEARCH CONFIGURATION public.default ( COPY = pg_catalog.english )

So guess what? I

  1. changed from mysql to postgresql in my rails config
  2. ran that "CREATE TEXT" code in the sql pain of pgAdmin (a gui for postgres)
  3. noticed that now my development DB has something called an "FTS configuration"
  4. tried the search functionality and it works GREAT

But I'm having trouble getting that configuration to show up in the schema. When I did rake db:dump it doesn't make it in there. I know I can add this line to the schema.rb:

execute 'CREATE TEXT SEARCH CONFIGURATION public.default ( COPY = pg_catalog.english )'

and that works, but how can I get that configuration into the schema without my having to hand-add it? Can I create a f开发者_运维知识库ile that is also loaded after schema.rb when someone types rake db:load?

And for the postgres people, a question: What does that CREATE TEXT SEARCH CONFIGURATION... do?


Why don't you try adding it to a migration file and rake that against the heroku db?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜