makandra / geordi

Collection of command line tools used in our daily work with Ruby, Rails and Linux.
https://makandra.com/
MIT License
103 stars 17 forks source link

drop-databases with --sudo option throws an error #208

Closed brunosedler closed 10 months ago

brunosedler commented 11 months ago

Without the --sudo option, I'm getting

# Checking for Postgres databases psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "codener" does not exist No postgres databases found that were not allowlisted.

Does this mean I have a nonstandard setup? Anyways, the error should be detected, i.e. the script should not continue with "no databases found". If possible, please suggest to use the --sudo option.

Also, renaming for "fair language" broke reference to previous allowlists/blocklists, which forces all users to create their lists again. As this also means the old lists with the "bad names" remain at their old locations, we should add migration code that renames the old lists.

Please also:

Originally posted by @codener in https://github.com/makandra/geordi/issues/199#issuecomment-1819130371