-
Notifications
You must be signed in to change notification settings - Fork 19
Configuration options
This page is not a required read. Consult it only if you're looking for something specific.
This plugin should just work with no configuration whatsoever. However, configuration is possible. Put all your configs in capistrano stage files i.e. config/deploy/production.rb
.
Here's the list of options and the defaults for each option:
-
set :pg_database
Name of the database for your app. Defaults to#{application}_#{stage}
, example:myface_production
. -
set :pg_user
Name of the database user. Defaults to whatever is set forpg_database
option. -
set :pg_password
Password for the database user. By default this option is not set and a new random password is generated each time you create a new database.
If you set this option to"some_secure_password"
- that will be the db user's password. Keep in mind that having a hardcoded password indeploy.rb
(or anywhere in version control) is a bad practice.
I recommend sticking to the default and generating a new secure and random password each time a db user is generated. That way you don't have to worry about it or try to remember it. -
set :pg_ask_for_password
Defaultfalse
. Set this option totrue
if you want to be prompted for the password when database user is created. This is safer than setting the password viapg_password
. The downside is you have to choose and remember yet another fricking password.
pg_password
option has precedence. If it is set,pg_ask_for_password
is ignored. -
set :pg_system_user
Defaultpostgres
. Set this option to the user that owns the postgres process on your system. Normally the default is fine, but for instance on FreeBSD the default prostgres user ispgsql
. -
set :pg_system_db
Defaultpostgres
. Set this if the system database don't have the standard name. Usually there should be no reason to change this from the default. -
set :pg_extensions
Defaults to empty array[]
. If for example, you want to install "hstore" extension, just add add it to the array withset :pg_extension, ["hstore"]
. -
set :pg_use_hstore
(deprecated, usepg_extensions
option)
Defaultfalse
. If true, thepostgresql:add_hstore
task is executed and the hstore extension is added to:pg_database
.
database.yml
template-only settings:
-
set :pg_env
DB environment. Defaults to the value ofrails_env
option. Ifrails_env
is not set, it defaults tostage
option. -
set :pg_pool
Pool config indatabase.yml
template. Defaults to5
. -
set :pg_host
hostname
config indatabase.yml
template. Defaults tolocalhost
. -
set :pg_encoding
encoding
config indatabase.yml
template. Defaults tounicode
.