Ruby on Rails: How can i edit database.yml for postgresql?

前端 未结 7 1227
我寻月下人不归
我寻月下人不归 2020-12-08 06:26

rails new app=>

The current database.yml is like that=>

# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your         


        
7条回答
  •  佛祖请我去吃肉
    2020-12-08 07:00

    As Zabba said it's

    development:
      adapter: postgresql
      encoding: unicode
      database: blog_development
      pool: 5
      username: blog
      password:
    

    As mentioned in the Configuring Rails Applications. But you might want an additional min_messages: WARNING, to get rid of the nasty NOTICE messages postgresql gives you during a migration. So my database.yml entry looks like this

    development:
      adapter: postgresql
      encoding: unicode
      database: blog_development
      pool: 5
      username: blog
      password:
      min_messages: WARNING
    

提交回复
热议问题