From af49b3390ce352297c3b601c69b6b0557a9ae01d Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 11 Jan 2013 19:30:56 +0100 Subject: Load the production database configuration from the system odbc.ini file. --- config/database.yml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'config') diff --git a/config/database.yml b/config/database.yml index bd1748e..706ed06 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,13 +1,26 @@ development: + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 + +# Read the database configuration from the system odbc +# configuration. +# +<%- system_odbc_ini_file = '/var/lib/.odbc.ini' %> +<%- if File.exists?(system_odbc_ini_file) %> +<%- system_odbc_configuration = IniFile.load(system_odbc_ini_file) %> +<%- if !system_odbc_configuration['gemeinschaft']['DATABASE'].blank? && !system_odbc_configuration['gemeinschaft']['USER'].blank? %> +production: adapter: mysql2 encoding: utf8 - database: gemeinschaft - pool: 5 - username: gemeinschaft - password: gemeinschaft + database: <%= system_odbc_configuration['gemeinschaft']['DATABASE'] %> + pool: 10 + username: <%= system_odbc_configuration['gemeinschaft']['USER'] %> + password: <%= system_odbc_configuration['gemeinschaft']['PASSWORD'] %> socket: /var/run/mysqld/mysqld.sock - reconnect: true - + reconnect: true +<%- else %> production: adapter: mysql2 encoding: utf8 @@ -17,6 +30,8 @@ production: password: gemeinschaft socket: /var/run/mysqld/mysqld.sock reconnect: true +<%- end %> +<%- end %> # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". -- cgit v1.2.3