-
-
Save Prabodh-Panda/a0d3adf9c28bf3028fbb8059d0687e9d to your computer and use it in GitHub Desktop.
Rails Database yml examples for postgres sqlite and mysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install the MySQL gem: | |
| # gem install mysql2 | |
| default: &default | |
| adapter: mysql2 | |
| encoding: utf8mb4 | |
| reconnect: false | |
| pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
| username: root | |
| password: | |
| socket: /tmp/mysql.sock | |
| development: | |
| <<: *default | |
| database: app_name_development | |
| test: | |
| <<: *default | |
| database: app_name_test | |
| staging: | |
| <<: *default | |
| database: app_name_staging | |
| production: | |
| <<: *default | |
| database: app_name_production |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install the pg gem: | |
| # gem install pg | |
| default: &default | |
| adapter: postgresql | |
| encoding: unicode | |
| host: localhost | |
| pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
| username: postgres | |
| password: | |
| development: | |
| <<: *default | |
| database: app_name_development | |
| test: | |
| <<: *default | |
| database: app_name_test | |
| staging: | |
| <<: *default | |
| database: app_name_staging | |
| production: | |
| <<: *default | |
| database: app_name_production |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SQLite version 3.x | |
| # gem install sqlite3 | |
| default: &default | |
| adapter: sqlite3 | |
| pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
| timeout: 5000 | |
| development: | |
| <<: *default | |
| database: db/development.sqlite3 | |
| # Warning: The database defined as "test" will be erased and | |
| # re-generated from your development database when you run "rake". | |
| # Do not set this db to the same as development or production. | |
| test: | |
| <<: *default | |
| database: db/test.sqlite3 | |
| staging: | |
| <<: *default | |
| database: db/staging.sqlite3 | |
| production: | |
| <<: *default | |
| database: db/production.sqlite3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment