Skip to content

Commit

Permalink
Fix to specify 'postgres' as the database when checking for database …
Browse files Browse the repository at this point in the history
…existence
  • Loading branch information
patorash committed Sep 10, 2024
1 parent 5bfd953 commit 83ec14a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hanami/cli/commands/app/db/utils/postgres.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module Utils
class Postgres < Database
# @api private
def create_command
existing_stdout, status = Open3.capture2(cli_env_vars, "psql -t -c '\\l #{escaped_name}'")
existing_stdout, status = Open3.capture2(cli_env_vars.merge("PGDATABASE" => "postgres"), "psql -t -c '\\l #{escaped_name}'")

return true if status.success? && existing_stdout.include?(escaped_name)

Expand Down

0 comments on commit 83ec14a

Please sign in to comment.