public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Use 'public' schema path when connecting to 'postgres' database. [#170 
state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Tarmo Tänav (author)
Tue May 13 10:20:52 -0700 2008
lifo (committer)
Tue May 13 10:25:30 -0700 2008
commit  3fee2378edd45188e41a7d14d4ca0a88280b541e
tree    d8d41b6efd8fd48c43af0ca265b699f47ae5d96b
parent  f498f221bdd88a04458f56ee917c360bca833e94
...
45
46
47
48
 
49
50
51
...
368
369
370
371
 
372
373
374
...
45
46
47
 
48
49
50
51
...
368
369
370
 
371
372
373
374
0
@@ -45,7 +45,7 @@ namespace :db do
0
       when 'postgresql'
0
         @encoding = config[:encoding] || ENV['CHARSET'] || 'utf8'
0
         begin
0
-          ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres'))
0
+          ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public'))
0
           ActiveRecord::Base.connection.create_database(config['database'], config.merge('encoding' => @encoding))
0
           ActiveRecord::Base.establish_connection(config)
0
         rescue
0
@@ -368,7 +368,7 @@ def drop_database(config)
0
   when /^sqlite/
0
     FileUtils.rm(File.join(RAILS_ROOT, config['database']))
0
   when 'postgresql'
0
-    ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres'))
0
+    ActiveRecord::Base.establish_connection(config.merge('database' => 'postgres', 'schema_search_path' => 'public'))
0
     ActiveRecord::Base.connection.drop_database config['database']
0
   end
0
 end

Comments