Use 'public' schema path when connecting to 'postgres' database. [#170 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
parent
f498f221bd
commit
3fee2378ed
@ -45,7 +45,7 @@ namespace :db do
|
||||
when 'postgresql'
|
||||
@encoding = config[:encoding] || ENV['CHARSET'] || 'utf8'
|
||||
begin
|
||||
ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres'))
|
||||
ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public'))
|
||||
ActiveRecord::Base.connection.create_database(config['database'], config.merge('encoding' => @encoding))
|
||||
ActiveRecord::Base.establish_connection(config)
|
||||
rescue
|
||||
@ -368,7 +368,7 @@ def drop_database(config)
|
||||
when /^sqlite/
|
||||
FileUtils.rm(File.join(RAILS_ROOT, config['database']))
|
||||
when 'postgresql'
|
||||
ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres'))
|
||||
ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public'))
|
||||
ActiveRecord::Base.connection.drop_database config['database']
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user