1
+ # PostgreSQL. Versions 9.1 and up are supported.
2
+ #
3
+ # Install the pg driver:
4
+ # gem install pg
5
+ # On OS X with Homebrew:
6
+ # gem install pg -- --with-pg-config=/usr/local/bin/pg_config
7
+ # On OS X with MacPorts:
8
+ # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
9
+ # On Windows:
10
+ # gem install pg
11
+ # Choose the win32 build.
12
+ # Install PostgreSQL and put its /bin directory on your path.
13
+ #
14
+ # Configure Using Gemfile
15
+ # gem 'pg'
16
+ #
17
+ default : &default
18
+ adapter : postgresql
19
+ encoding : unicode
20
+ # For details on connection pooling, see Rails configuration guide
21
+ # http://guides.rubyonrails.org/configuring.html#database-pooling
22
+ pool : <%= 1 + 2 + ENV.fetch("GOOD_JOB_MAX_THREADS", 5).to_i %>
23
+ database : <%= ENV['DATABASE_NAME'] %>
24
+ username : <%= ENV['DATABASE_USER'] %>
25
+ password : <%= ENV['DATABASE_PASSWORD'] %>
26
+ port : <%= ENV['DATABASE_PORT'] || '5432' %>
27
+ host : <%= ENV['DATABASE_HOST'] %>
28
+
29
+ development :
30
+ << : *default
31
+ database : inventory-control_development
32
+ pool : <%= ENV.fetch("RAILS_MAX_THREADS", 5).to_i + 1 + 2 + ENV.fetch("GOOD_JOB_MAX_THREADS", 5).to_i %>
33
+
34
+ # check best practices for good_job https://github.com/bensheldon/good_job#database-connections
35
+ # The specified database role being used to connect to postgres.
36
+ # To create additional roles in postgres see `$ createuser --help`.
37
+ # When left blank, postgres will use the default role. This is
38
+ # the same name as the operating system user that initialized the database.
39
+ # username: inventory-control
40
+
41
+ # The password associated with the postgres role (username).
42
+ # password:
43
+
44
+ # Connect on a TCP socket. Omitted by default since the client uses a
45
+ # domain socket that doesn't need configuration. Windows does not have
46
+ # domain sockets, so uncomment these lines.
47
+ # host: localhost
48
+
49
+ # The TCP port the server listens on. Defaults to 5432.
50
+ # If your server runs on a different port number, change accordingly.
51
+ # port: 5432
52
+
53
+ # Schema search path. The server defaults to $user,public
54
+ # schema_search_path: myapp,sharedapp,public
55
+
56
+ # Minimum log levels, in increasing order:
57
+ # debug5, debug4, debug3, debug2, debug1,
58
+ # log, notice, warning, error, fatal, and panic
59
+ # Defaults to warning.
60
+ # min_messages: notice
61
+
62
+ # Warning: The database defined as "test" will be erased and
63
+ # re-generated from your development database when you run "rake".
64
+ # Do not set this db to the same as development or production.
65
+ test :
66
+ << : *default
67
+ database : inventory-control_test
68
+
69
+ # As with config/secrets.yml, you never want to store sensitive information,
70
+ # like your database password, in your source code. If your source code is
71
+ # ever seen by anyone, they now have access to your database.
72
+ #
73
+ # Instead, provide the password as a unix environment variable when you boot
74
+ # the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
75
+ # for a full rundown on how to provide these environment variables in a
76
+ # production deployment.
77
+ #
78
+ # On Heroku and other platform providers, you may have a full connection URL
79
+ # available as an environment variable. For example:
80
+ #
81
+ # DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
82
+ #
83
+ # You can use this database configuration with:
84
+ #
85
+ # production:
86
+ # url: <%= ENV['DATABASE_URL'] %>
87
+ #
88
+ # check best practices for good job https://github.com/bensheldon/good_job#database-connections
89
+ # https://github:com/bensheldon/good_job#production-setup
90
+ production :
91
+ << : *default
92
+ database : inventory-control_production
93
+ username : inventory-control
94
+ password : <%= ENV['INVENTORY-CONTROL_DATABASE_PASSWORD'] %>
95
+ pool : <%= ENV.fetch("RAILS_MAX_THREADS", 20).to_i + 1 + 2 + ENV.fetch("GOOD_JOB_MAX_THREADS", 20).to_i %>
96
+
97
+ # check best practices for good job https://github.com/bensheldon/good_job#database-connections
98
+ staging :
99
+ << : *default
100
+ database : inventory-control_staging
101
+ username : inventory-control
102
+ password : <%= ENV['INVENTORY-CONTROL_DATABASE_PASSWORD'] %>
103
+ pool : <%= 1 + 2 + ENV.fetch("GOOD_JOB_MAX_THREADS", 5).to_i %>
0 commit comments