mirror of https://github.com/rails/rails
Merge pull request #13569 from schneems/schneems/default-url-sub-key
Move default production database to URL sub key
This commit is contained in:
commit
55dc36b227
|
@ -25,4 +25,5 @@ test:
|
||||||
|
|
||||||
# Do not keep production credentials in the repository,
|
# Do not keep production credentials in the repository,
|
||||||
# instead read the configuration from the environment.
|
# 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,
|
# Do not keep production credentials in the repository,
|
||||||
# instead read the configuration from the environment.
|
# 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,
|
# Do not keep production credentials in the repository,
|
||||||
# instead read the configuration from the environment.
|
# 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,
|
# Do not keep production credentials in the repository,
|
||||||
# instead read the configuration from the environment.
|
# 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,
|
# Do not keep production credentials in the repository,
|
||||||
# instead read the configuration from the environment.
|
# instead read the configuration from the environment.
|
||||||
production: <%%= ENV["RAILS_DATABASE_URL"] %>
|
production:
|
||||||
|
url: <%%= ENV["RAILS_DATABASE_URL"] %>
|
||||||
|
|
|
@ -38,4 +38,5 @@ test:
|
||||||
# Example:
|
# Example:
|
||||||
# mysql2://myuser:mypass@localhost/somedatabase
|
# 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,
|
# Do not keep production credentials in the repository,
|
||||||
# instead read the configuration from the environment.
|
# instead read the configuration from the environment.
|
||||||
production: <%%= ENV["RAILS_DATABASE_URL"] %>
|
production:
|
||||||
|
url: <%%= ENV["RAILS_DATABASE_URL"] %>
|
||||||
|
|
|
@ -65,4 +65,5 @@ test:
|
||||||
# Example:
|
# Example:
|
||||||
# postgres://myuser:mypass@localhost/somedatabase
|
# 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.
|
# instead read the configuration from the environment.
|
||||||
#
|
#
|
||||||
# Example:
|
# 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,
|
# Do not keep production credentials in the repository,
|
||||||
# instead read the configuration from the environment.
|
# instead read the configuration from the environment.
|
||||||
production: <%%= ENV["RAILS_DATABASE_URL"] %>
|
production:
|
||||||
|
url: <%%= ENV["RAILS_DATABASE_URL"] %>
|
||||||
|
|
|
@ -24,7 +24,11 @@ module ApplicationTests
|
||||||
# ensure it's using the DATABASE_URL
|
# ensure it's using the DATABASE_URL
|
||||||
FileUtils.rm_rf("#{app_path}/config/database.yml")
|
FileUtils.rm_rf("#{app_path}/config/database.yml")
|
||||||
File.open("#{app_path}/config/database.yml", 'w') do |f|
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue