Files
robbiepaul 298610b5f6
CI / test (3.4.1) (push) Has been cancelled
Initial commit (history cleared)
2026-04-29 11:21:39 +01:00

55 lines
1.5 KiB
YAML
Executable File

# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
<% user = ENV.key?("POSTGRESQL_ADMIN_PASSWORD") ? "root" : ENV["POSTGRESQL_USER"] %>
<% password = ENV.key?("POSTGRESQL_ADMIN_PASSWORD") ? ENV["POSTGRESQL_ADMIN_PASSWORD"] : ENV["POSTGRESQL_PASSWORD"] %>
<% db_service = ENV.fetch("DATABASE_SERVICE_NAME","").upcase %>
development:
<% if ENV["DATABASE_URL"] %>
url: <%= ENV["DATABASE_URL"] %>
<% else %>
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
<% end %>
mysql:
adapter: mysql2
database: development_railsgoat
pool: 5
timeout: 5000
host: localhost
username: root
password:
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rails".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
openshift:
adapter: postgresql
encoding: unicode
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV["POSTGRESQL_MAX_CONNECTIONS"] || 5 %>
username: <%= user %>
password: <%= password %>
host: <%= ENV["#{db_service}_SERVICE_HOST"] %>
port: <%= ENV["#{db_service}_SERVICE_PORT"] %>
database: <%= ENV["POSTGRESQL_DATABASE"] %>