How can I create a Postgres user and database whenever I create a new rails app?

后端 未结 2 1797
囚心锁ツ
囚心锁ツ 2021-02-09 20:49

I have followed this really helpful tutorial:

http://blog.willj.net/2011/05/31/setting-up-postgresql-for-ruby-on-rails-development-on-os-x/

I would really like t

2条回答
  •  孤独总比滥情好
    2021-02-09 21:19

    On a unix based system:

    sudo -u postgres createuser -d -R -P APPNAME
    sudo -u postgres createdb -O APPNAME APPNAME
    

    You can create a script and put it somewhere in your $PATH if you can't remember.

提交回复
热议问题