diff options
author | Kyle Hargraves <philodespotos@gmail.com> | 2008-05-16 06:51:39 -0500 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-05-16 13:10:14 +0100 |
commit | 77f873acf2f1fb4533dfca6b26b965a115ebbc54 (patch) | |
tree | 2d4c04d3897fcc8bf0e41aabd5495b498bdf66b0 /railties/lib/commands | |
parent | 150717344aa5c6d8f46fc67de39d6947553ac286 (diff) | |
download | rails-77f873acf2f1fb4533dfca6b26b965a115ebbc54.tar.gz rails-77f873acf2f1fb4533dfca6b26b965a115ebbc54.tar.bz2 rails-77f873acf2f1fb4533dfca6b26b965a115ebbc54.zip |
dbconsole should not require a username for postgresql. [#207 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'railties/lib/commands')
-rw-r--r-- | railties/lib/commands/dbconsole.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/commands/dbconsole.rb b/railties/lib/commands/dbconsole.rb index 3e5010c688..b81997aa59 100644 --- a/railties/lib/commands/dbconsole.rb +++ b/railties/lib/commands/dbconsole.rb @@ -40,10 +40,11 @@ when "mysql" exec(find_cmd('mysql5', 'mysql'), *args) when "postgresql" + ENV['PGUSER'] = config["username"] if config["username"] ENV['PGHOST'] = config["host"] if config["host"] ENV['PGPORT'] = config["port"].to_s if config["port"] ENV['PGPASSWORD'] = config["password"].to_s if config["password"] - exec(find_cmd('psql'), '-U', config["username"], config["database"]) + exec(find_cmd('psql'), config["database"]) when "sqlite" exec(find_cmd('sqlite'), config["database"]) |