David Arango 12 years ago
parent de1364c8b3
commit 4fddeb647a

@ -7,18 +7,18 @@ module CartoDB
if @@connection
@@connection
else
c = ::Sequel.connect('postgres://lorenzo:@localhost:5432/cartodb_importer_test')
c = ::Sequel.connect('postgres://postgres:@localhost:5432/cartodb_importer_test')
begin
c.test_connection
@@connection = c
rescue
c = ::Sequel.connect('postgres://lorenzo:@localhost:5432')
c = ::Sequel.connect('postgres://postgres:@localhost:5432')
c.run <<-SQL
CREATE DATABASE cartodb_importer_test
WITH TEMPLATE = template_postgis
OWNER = lorenzo
OWNER = postgres
SQL
@@connection = ::Sequel.connect('postgres://lorenzo:@localhost:5432/cartodb_importer_test')
@@connection = ::Sequel.connect('postgres://postgres:@localhost:5432/cartodb_importer_test')
end
return @@connection
end
@ -28,7 +28,7 @@ SQL
@@connection.disconnect
@@connection = nil
begin
c = ::Sequel.connect('postgres://lorenzo:@localhost:5432')
c = ::Sequel.connect('postgres://postgres:@localhost:5432')
c.run "DROP DATABASE cartodb_importer_test"
rescue => e
raise e

Loading…
Cancel
Save