diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml index 48079863338b4510c2b6804b14f8dc5f936403bc..c6dfd50d409b0da1316aca5dec4ae104daa8dd9f 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/frontbase.yml @@ -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: '' diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml index 3d689a110a4e901b0ef8d30bc1b043e2410c8bee..fe53cd0ea2a261f6b311095b5d9f3b54ea28c2ec 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/ibm_db.yml @@ -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 diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml index 1d2bf08b91b061410a5c827cd615a92ac0cde77a..2a6cd4f3f4ad984291d2bac2c953f816347bf38b 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/jdbc.yml @@ -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 diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml index 5a594ac1f39f086040ebff7327859d0bf40b1bb6..26e2a5976c1119740c1079b7d4c8c953010d322d 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcmysql.yml @@ -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 diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml index e1a00d076faba9dcdebd12fe68762472210db0fc..ccd44cf54be7faea6787707f34a27f8bcf0af602 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcpostgresql.yml @@ -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: diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml index 175f3eb3dbda2c0e9e64e6a36f359d2ad280efd0..28c36eb82f4d3d0cfb341aa13e923e32d1d0cb9e 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/jdbcsqlite3.yml @@ -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 diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml index c3349912aac0a447870b6c21cb781299448d6d6b..3fc7ce28a1fdb6fdad9976f6f0a0ef4add378a90 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/mysql.yml @@ -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 -%> diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/oracle.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/oracle.yml index b661a60389e115b6780cd7d2194ee789a947ecab..d5b52c969baafb606408d41d229d8e6ed6bcbbb1 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/oracle.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/oracle.yml @@ -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: diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml index 0194dce6f373ab4933ec6284ee7e1072098fe9f2..eaeb82bdddc9b6a9204e6bc56ed8775e3b9c100d 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/postgresql.yml @@ -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: diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml index 51a4dd459dc12673ad440debb28f499c89550022..1c1a37ca8df8dafd501066d54086ca5693f4b204 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlite3.yml @@ -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 diff --git a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml index 7ef89d660814c3bd0e3401e6ef4a3d168ba116e1..4855f66c0d1d103227d540a59f48da58476cf65f 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml +++ b/railties/lib/rails/generators/rails/app/templates/config/databases/sqlserver.yml @@ -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