Skip to content

Commit 15f9449

Browse files
committed
Use postgis schema in database URL
This fixes an issue where the database adapter is not set correctly in deployed environments as the schema in the URL is used to determine the adapter. We need to use `postgis` so that we can use the features of PostGIS. Jira-Issue: 6706
1 parent acaf477 commit 15f9449

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

config/application.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Application < Rails::Application
4141
dbname = db_config["dbname"]
4242
ENV[
4343
"DATABASE_URL"
44-
] = "postgres://#{username}:#{password}@#{host}:#{port}/#{dbname}"
44+
] = "postgis://#{username}:#{password}@#{host}:#{port}/#{dbname}"
4545
elsif ENV["DB_CREDENTIALS"].present?
4646
# for environment which uses RDS aurora managed credentials only the the username
4747
# and password is automatically set. The environment variable is then DB_CREDENTIALS
@@ -53,7 +53,7 @@ class Application < Rails::Application
5353
port = ENV.fetch("DB_PORT", 5432)
5454
ENV[
5555
"DATABASE_URL"
56-
] = "postgres://#{username}:#{password}@#{host}:#{port}/#{dbname}"
56+
] = "postgis://#{username}:#{password}@#{host}:#{port}/#{dbname}"
5757
end
5858

5959
# Configuration for the application, engines, and railties goes here.

0 commit comments

Comments
 (0)