Search code examples
ruby-on-railspostgresqlrake

How to create postgres database for Rails app manually?


How can I create postgres db for Rails app properly but in psql, not via rake db:create?

I mean, one can always write CREATE DATABASE project_name, but I don't know what happens in that rake task under the hood. Maybe there are a lot of additional params.

Update

After first answer I decided to clarify: I know how to write and use migrations, they are awesome, but my question not about them. It's about rake db:create task and pg adapter.

In other words, I just want to know which command in psql is equal to rake db:create.


Solution

  • If you select the db on pgadmin III it will show you the sql instructions with the local things to load. They are very importanst if you have full text index on. You must run them from the database postgres.