Permalink
Browse files

Merge pull request #13569 from schneems/schneems/default-url-sub-key

Move default production database to URL sub key
  • Loading branch information...
2 parents 821525e + 9749e0e commit 55dc36b227ea5d8548d97b6ef5519fdb7ace3657 @rafaelfranca rafaelfranca committed Jan 2, 2014
@@ -25,4 +25,5 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -63,4 +63,5 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -55,4 +55,5 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -44,4 +44,5 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -20,4 +20,5 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -38,4 +38,5 @@ test:
# Example:
# mysql2://myuser:mypass@localhost/somedatabase
#
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -34,4 +34,5 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -65,4 +65,5 @@ test:
# Example:
# postgres://myuser:mypass@localhost/somedatabase
#
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -24,6 +24,7 @@ test:
# instead read the configuration from the environment.
#
# Example:
-# sqlite3://myuser:mypass@localhost/somedatabase
+# sqlite3://myuser:mypass@localhost/full/path/to/somedatabase
#
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -44,4 +44,5 @@ test:
# Do not keep production credentials in the repository,
# instead read the configuration from the environment.
-production: <%%= ENV["RAILS_DATABASE_URL"] %>
+production:
+ url: <%%= ENV["RAILS_DATABASE_URL"] %>
@@ -24,7 +24,11 @@ def set_database_url
# ensure it's using the DATABASE_URL
FileUtils.rm_rf("#{app_path}/config/database.yml")
File.open("#{app_path}/config/database.yml", 'w') do |f|
- f << {ENV['RAILS_ENV'] => %Q{<%= ENV['RAILS_DATABASE_URL'] %>}}.to_yaml
+ yaml = <<-YAML.strip_heredoc
+ #{ENV['RAILS_ENV']}:
+ url: <%= ENV['RAILS_DATABASE_URL'] %>
+ YAML
+ f << yaml
end
end

0 comments on commit 55dc36b

Please sign in to comment.