-
Notifications
You must be signed in to change notification settings - Fork 19
How it works
Nathan Pierce edited this page Dec 29, 2017
·
6 revisions
This page is for those that want to learn more about the plugin internals. Reading this page is not required for successfully using the plugin.
Check here for full capistrano deployment flow http://capistranorb.com/documentation/getting-started/flow/.
The following tasks run during the setup task:
-
postgresql:remove_app_database_yml_files
deletes old yml files from all app role servers. Allows you to avoid having to manually delete the files on your web/app servers to get a new pool size for example. -
postgresql:create_db_user
creates a postgresql user. Password for the user is automatically generated and used in the next steps. -
postgresql:create_database
creates database for your app. -
postgresql:add_extensions
creates all extensions you specify in your config/deploy/{environment}.rb files. -
postgresql:generate_database_yml_archetype
creates adatabase.ymlfile and copies it to#{deploy_path}/db/database.ymlon the primarydbserver. -
postgresql:generate_database_yml
copiesdatabase.ymlfile from the primarydbserver to#{shared_path}/config/database.ymlon release server(s). -
postgresql:add_hstore
creates the hstore extension for your application database. This task only runs if:pg_use_hstoreis set to true (see Configuration Options).
Also, the plugin ensures config/database.yml is symlinked from shared_path.
The above tasks are all you need for getting a Rails app to work with PostgreSQL.