|
1 |
| -# SQLite. Versions 3.8.0 and up are supported. |
2 |
| -# gem install sqlite3 |
| 1 | +# PostgreSQL. Versions 9.3 and up are supported. |
3 | 2 | #
|
4 |
| -# Ensure the SQLite 3 gem is defined in your Gemfile |
5 |
| -# gem "sqlite3" |
| 3 | +# Install the pg driver: |
| 4 | +# gem install pg |
| 5 | +# On macOS with Homebrew: |
| 6 | +# gem install pg -- --with-pg-config=/usr/local/bin/pg_config |
| 7 | +# On Windows: |
| 8 | +# gem install pg |
| 9 | +# Choose the win32 build. |
| 10 | +# Install PostgreSQL and put its /bin directory on your path. |
| 11 | +# |
| 12 | +# Configure Using Gemfile |
| 13 | +# gem "pg" |
6 | 14 | #
|
7 | 15 | default: &default
|
8 |
| - adapter: sqlite3 |
| 16 | + adapter: postgresql |
| 17 | + encoding: unicode |
| 18 | + # For details on connection pooling, see Rails configuration guide |
| 19 | + # https://guides.rubyonrails.org/configuring.html#database-pooling |
9 | 20 | pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
10 |
| - timeout: 5000 |
| 21 | + username: postgres |
| 22 | + host: localhost |
| 23 | + port: 5432 |
11 | 24 |
|
12 | 25 | development:
|
13 | 26 | <<: *default
|
14 |
| - database: db/development.sqlite3 |
| 27 | + database: demo_rails_development |
| 28 | + |
| 29 | + # The specified database role being used to connect to PostgreSQL. |
| 30 | + # To create additional roles in PostgreSQL see `$ createuser --help`. |
| 31 | + # When left blank, PostgreSQL will use the default role. This is |
| 32 | + # the same name as the operating system user running Rails. |
| 33 | + #username: blog |
| 34 | + |
| 35 | + # The password associated with the PostgreSQL role (username). |
| 36 | + #password: |
| 37 | + |
| 38 | + # Connect on a TCP socket. Omitted by default since the client uses a |
| 39 | + # domain socket that doesn't need configuration. Windows does not have |
| 40 | + # domain sockets, so uncomment these lines. |
| 41 | + #host: localhost |
| 42 | + |
| 43 | + # The TCP port the server listens on. Defaults to 5432. |
| 44 | + # If your server runs on a different port number, change accordingly. |
| 45 | + #port: 5432 |
| 46 | + |
| 47 | + # Schema search path. The server defaults to $user,public |
| 48 | + #schema_search_path: myapp,sharedapp,public |
| 49 | + |
| 50 | + # Minimum log levels, in increasing order: |
| 51 | + # debug5, debug4, debug3, debug2, debug1, |
| 52 | + # log, notice, warning, error, fatal, and panic |
| 53 | + # Defaults to warning. |
| 54 | + #min_messages: notice |
15 | 55 |
|
16 | 56 | # Warning: The database defined as "test" will be erased and
|
17 | 57 | # re-generated from your development database when you run "rake".
|
18 | 58 | # Do not set this db to the same as development or production.
|
19 | 59 | test:
|
20 | 60 | <<: *default
|
21 |
| - database: db/test.sqlite3 |
| 61 | + database: demo_rails_test |
22 | 62 |
|
| 63 | +# As with config/credentials.yml, you never want to store sensitive information, |
| 64 | +# like your database password, in your source code. If your source code is |
| 65 | +# ever seen by anyone, they now have access to your database. |
| 66 | +# |
| 67 | +# Instead, provide the password or a full connection URL as an environment |
| 68 | +# variable when you boot the app. For example: |
| 69 | +# |
| 70 | +# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase" |
| 71 | +# |
| 72 | +# If the connection URL is provided in the special DATABASE_URL environment |
| 73 | +# variable, Rails will automatically merge its configuration values on top of |
| 74 | +# the values provided in this file. Alternatively, you can specify a connection |
| 75 | +# URL environment variable explicitly: |
| 76 | +# |
| 77 | +# production: |
| 78 | +# url: <%= ENV["MY_APP_DATABASE_URL"] %> |
| 79 | +# |
| 80 | +# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database |
| 81 | +# for a full overview on how database connection configuration can be specified. |
| 82 | +# |
23 | 83 | production:
|
24 | 84 | <<: *default
|
25 |
| - database: db/production.sqlite3 |
| 85 | + database: demo_rails_production |
| 86 | + username: postgres |
| 87 | + password: <%= ENV["BLOG_DATABASE_PASSWORD"] %> |
0 commit comments