提交 8ed188ca 编写于 作者: X Xavier Noria

Merge pull request #12292 from bf4/better_database_yaml

Extract common database defaults; better use of YAML
......@@ -6,26 +6,23 @@
# Configure Using Gemfile
# gem 'ruby-frontbase'
#
development:
default: &default
adapter: frontbase
host: localhost
database: <%= app_name %>_development
username: <%= app_name %>
password: ''
development:
<<: *default
database: <%= app_name %>_development
# 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:
adapter: frontbase
host: localhost
<<: *default
database: <%= app_name %>_test
username: <%= app_name %>
password: ''
production:
adapter: frontbase
host: localhost
<<: *default
database: <%= app_name %>_production
username: <%= app_name %>
password: ''
......@@ -33,12 +33,11 @@
#
# For more details on the installation and the connection parameters below,
# please refer to the latest documents at http://rubyforge.org/docman/?group_id=2361
development:
#
default: &default
adapter: ibm_db
username: db2inst1
password:
database: <%= app_name[0,4] %>_dev
#schema: db2inst1
#host: localhost
#port: 50000
......@@ -51,36 +50,17 @@ development:
#authentication: SERVER
#parameterized: false
development:
<<: *default
database: <%= app_name[0,4] %>_dev
# 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:
adapter: ibm_db
username: db2inst1
password:
<<: *default
database: <%= app_name[0,4] %>_tst
#schema: db2inst1
#host: localhost
#port: 50000
#account: my_account
#app_user: my_app_user
#application: my_application
#workstation: my_workstation
#security: SSL
#timeout: 10
#authentication: SERVER
#parameterized: false
production:
adapter: ibm_db
username: db2inst1
password:
<<: *default
database: <%= app_name[0,8] %>
#schema: db2inst1
#host: localhost
#port: 50000
#account: my_account
#app_user: my_app_user
#application: my_application
#workstation: my_workstation
#security: SSL
#timeout: 10
#authentication: SERVER
#parameterized: false
\ No newline at end of file
......@@ -36,27 +36,23 @@
# file). See your driver documentation for the apropriate driver class and
# connection string:
development:
default: &default
adapter: jdbc
username: <%= app_name %>
password:
driver:
development:
<<: *default
url: jdbc:db://localhost/<%= app_name %>_development
# 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:
adapter: jdbc
username: <%= app_name %>
password:
driver:
<<: *default
url: jdbc:db://localhost/<%= app_name %>_test
production:
adapter: jdbc
username: <%= app_name %>
password:
driver:
<<: *default
url: jdbc:db://localhost/<%= app_name %>_production
......@@ -8,26 +8,24 @@
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
#
default: &default
adapter: mysql
database: <%= app_name %>_development
username: root
password:
host: localhost
development:
<<: *default
database: <%= app_name %>_development
# 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:
adapter: mysql
<<: *default
database: <%= app_name %>_test
username: root
password:
host: localhost
production:
adapter: mysql
<<: *default
database: <%= app_name %>_production
username: root
password:
host: localhost
......@@ -2,14 +2,17 @@
#
# Configure Using Gemfile
# gem 'activerecord-jdbcpostgresql-adapter'
development:
#
default: &default
adapter: postgresql
encoding: unicode
database: <%= app_name %>_development
username: <%= app_name %>
password:
development:
<<: *default
database: <%= app_name %>_development
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
......@@ -29,15 +32,9 @@ development:
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
encoding: unicode
<<: *default
database: <%= app_name %>_test
username: <%= app_name %>
password:
production:
adapter: postgresql
encoding: unicode
<<: *default
database: <%= app_name %>_production
username: <%= app_name %>
password:
......@@ -4,17 +4,20 @@
# Configure Using Gemfile
# gem 'activerecord-jdbcsqlite3-adapter'
#
development:
default: &default
adapter: sqlite3
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:
adapter: sqlite3
<<: *default
database: db/test.sqlite3
production:
adapter: sqlite3
<<: *default
database: db/production.sqlite3
......@@ -8,10 +8,10 @@
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
#
default: &default
adapter: mysql2
encoding: utf8
database: <%= app_name %>_development
pool: 5
username: root
password:
......@@ -21,31 +21,17 @@ development:
host: localhost
<% end -%>
development:
<<: *default
database: <%= app_name %>_development
# 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:
adapter: mysql2
encoding: utf8
<<: *default
database: <%= app_name %>_test
pool: 5
username: root
password:
<% if mysql_socket -%>
socket: <%= mysql_socket %>
<% else -%>
host: localhost
<% end -%>
production:
adapter: mysql2
encoding: utf8
<<: *default
database: <%= app_name %>_production
pool: 5
username: root
password:
<% if mysql_socket -%>
socket: <%= mysql_socket %>
<% else -%>
host: localhost
<% end -%>
......@@ -16,24 +16,22 @@
# prefetch_rows: 100
# cursor_sharing: similar
#
development:
default: &default
adapter: oracle
database: <%= app_name %>_development
username: <%= app_name %>
password:
development:
<<: *default
database: <%= app_name %>_development
# 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:
adapter: oracle
<<: *default
database: <%= app_name %>_test
username: <%= app_name %>
password:
production:
adapter: oracle
<<: *default
database: <%= app_name %>_production
username: <%= app_name %>
password:
......@@ -14,14 +14,19 @@
# Configure Using Gemfile
# gem 'pg'
#
development:
default: &default
adapter: postgresql
encoding: unicode
database: <%= app_name %>_development
# For details on connection pooling, see rails configration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: 5
username: <%= app_name %>
password:
development:
<<: *default
database: <%= app_name %>_development
# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
......@@ -44,19 +49,9 @@ development:
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: postgresql
encoding: unicode
<<: *default
database: <%= app_name %>_test
pool: 5
username: <%= app_name %>
password:
production:
adapter: postgresql
encoding: unicode
<<: *default
database: <%= app_name %>_production
# For details on connection pooling, see rails configration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: 5
username: <%= app_name %>
password:
......@@ -3,23 +3,23 @@
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
#
default: &default
adapter: sqlite3
database: db/development.sqlite3
pool: 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:
adapter: sqlite3
<<: *default
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
<<: *default
database: db/production.sqlite3
pool: 5
timeout: 5000
......@@ -21,37 +21,27 @@
# If you can connect with "tsql -S servername", your basic FreeTDS installation is working.
# 'man tsql' for more info
# Set timeout to a larger number if valid queries against a live db fail
development:
#
default: &default
adapter: sqlserver
encoding: utf8
reconnect: false
database: <%= app_name %>_development
username: <%= app_name %>
password:
timeout: 25
dataserver: from_freetds.conf
development:
<<: *default
database: <%= app_name %>_development
# 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:
adapter: sqlserver
encoding: utf8
reconnect: false
<<: *default
database: <%= app_name %>_test
username: <%= app_name %>
password:
timeout: 25
dataserver: from_freetds.conf
production:
adapter: sqlserver
encoding: utf8
reconnect: false
<<: *default
database: <%= app_name %>_production
username: <%= app_name %>
password:
timeout: 25
dataserver: from_freetds.conf
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册