Last active
April 22, 2016 17:23
-
-
Save Fryguy/1db152f7e6e8be88b239 to your computer and use it in GitHub Desktop.
database.yml for multiple MIQ databases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PostgreSQL | |
# | |
# Development version of the standard database.yml that handles switching | |
# between different version branches. For example, on trunk it will look for a | |
# database named vmdb_development, but on the 3.3.2.12 branch it will look for | |
# a database named vmdb_development_3_3_2. | |
# | |
# <% unless $db_yml_loaded %> | |
# <% $db_yml_loaded = true %> | |
# <% version = File.read(Rails.root.join('VERSION')).chomp rescue 'master' %> | |
# <% productized = " (productized)" if Dir.exist?(Rails.root.join('productization')) %> | |
# <% db_suffix = case version; when 'master' then nil; when /^darga/ then "_darga"; else "_#{version.split('.')[0..1].join('_')}"; end %> | |
# <% c = YAML.load_file(Rails.root.join("config/database.yml"))[Rails.env] %> | |
# <% c.keys.each { |k| c[k] = ERB.new(v = c[k], nil, nil, 'v').result(binding).lines.first if c[k].is_a?(String) } %> | |
# <% puts "** #{version}#{productized} - #{c["database"]} on #{c["host"]}" %> | |
# <% end %> | |
--- | |
base: &base | |
adapter: postgresql | |
encoding: utf8 | |
host: localhost | |
username: root | |
pool: 5 | |
wait_timeout: 5 | |
development: | |
<<: *base | |
database: vmdb_development<%=db_suffix%> | |
production: | |
<<: *base | |
database: vmdb_production<%=db_suffix%> | |
test: &test | |
<<: *base | |
database: vmdb_test<%=db_suffix%> | |
# Silence these: 'NOTICE: CREATE TABLE will create...' | |
min_messages: warning |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment