diff options
author | Tarmo Tänav <tarmo@itech.ee> | 2008-05-13 20:20:52 +0300 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-13 18:25:30 +0100 |
commit | 3fee2378edd45188e41a7d14d4ca0a88280b541e (patch) | |
tree | d8d41b6efd8fd48c43af0ca265b699f47ae5d96b /railties | |
parent | f498f221bdd88a04458f56ee917c360bca833e94 (diff) | |
download | rails-3fee2378edd45188e41a7d14d4ca0a88280b541e.tar.gz rails-3fee2378edd45188e41a7d14d4ca0a88280b541e.tar.bz2 rails-3fee2378edd45188e41a7d14d4ca0a88280b541e.zip |
Use 'public' schema path when connecting to 'postgres' database. [#170 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/tasks/databases.rake | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index fe099e30b9..f40f8463f7 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -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 |