fix: Specify external db with non-standard port (#2711)
POSTGRES_PORT was not taking effect if provided separately instead of using DATABASE_URL. This adds support for using databases running on non-standard ports. #1145 #1147 Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -5,6 +5,6 @@ require 'uri'
|
||||
if !ENV['DATABASE_URL'].nil? && ENV['DATABASE_URL'] != ''
|
||||
uri = URI(ENV['DATABASE_URL'])
|
||||
puts "export POSTGRES_HOST=#{uri.host} POSTGRES_PORT=#{uri.port} POSTGRES_USERNAME=#{uri.user}"
|
||||
else
|
||||
puts "export POSTGRES_PORT=5432"
|
||||
end
|
||||
elif ENV['POSTGRES_PORT'].nil? || ENV['POSTGRES_PORT'] == ''
|
||||
puts "export POSTGRES_PORT=5432"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user