summaryrefslogtreecommitdiff
path: root/config/database.yml
diff options
context:
space:
mode:
Diffstat (limited to 'config/database.yml')
-rw-r--r--config/database.yml36
1 files changed, 29 insertions, 7 deletions
diff --git a/config/database.yml b/config/database.yml
index bd1748e..364cbdb 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -1,22 +1,44 @@
-development:
- adapter: mysql2
+<% system_odbc_ini_file = '/var/lib/freeswitch/.odbc.ini' %>
+<% if !File.exists?(system_odbc_ini_file) %>
+development:
+ adapter: sqlite3
+ database: db/development.sqlite3
+ pool: 5
+ timeout: 5000
+
+production:
+ adapter: mysql2
encoding: utf8
database: gemeinschaft
- pool: 5
+ pool: 10
username: gemeinschaft
password: gemeinschaft
socket: /var/run/mysqld/mysqld.sock
- reconnect: true
+ reconnect: true
+<% else %>
+<% system_odbc_configuration = IniFile.load(system_odbc_ini_file) %>
+<% if !system_odbc_configuration['gemeinschaft']['DATABASE'].blank? && !system_odbc_configuration['gemeinschaft']['USER'].blank? %>
+development:
+ adapter: mysql2
+ encoding: utf8
+ database: <%= system_odbc_configuration['gemeinschaft']['DATABASE'] %>
+ pool: 5
+ username: <%= system_odbc_configuration['gemeinschaft']['USER'] %>
+ password: <%= system_odbc_configuration['gemeinschaft']['PASSWORD'] %>
+ socket: /var/run/mysqld/mysqld.sock
+ reconnect: true
production:
adapter: mysql2
encoding: utf8
- database: gemeinschaft
+ database: <%= system_odbc_configuration['gemeinschaft']['DATABASE'] %>
pool: 10
- username: gemeinschaft
- password: gemeinschaft
+ username: <%= system_odbc_configuration['gemeinschaft']['USER'] %>
+ password: <%= system_odbc_configuration['gemeinschaft']['PASSWORD'] %>
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".