zulip/scripts/setup
Alex Vandiver b0283c42f9 create-database: Treat "zulip" db without "zerver_messages" as empty.
A user who somehow got an empty `zulip` database, but without a
`zerver_messages` table in it, would get stuck in the installer at:

```
++ su postgres -c 'cd / && psql -v ON_ERROR_STOP=1 -Atc '\''SELECT COUNT(*) FROM zulip.zerver_message;'\'' zulip'
ERROR:  relation "zulip.zerver_message" does not exist
LINE 1: SELECT COUNT(*) FROM zulip.zerver_message;
                             ^
+ records=
```

Treat a failure to select from `zerver_messages` as having 0 messages,
and continue with the `DROP DATABASE IF EXISTS` / `CREATE DATABASE`
that `create-db.sql` usually does.

Fixes: #29110.
2024-03-08 10:10:19 -08:00
..
apt-repos install: Support Ubuntu 24.04. 2024-03-01 17:38:08 -08:00
__init__.py setup: Add missing __init__.py. 2021-07-05 12:20:39 -07:00
compare-settings-to-template ruff: Fix RUF027 Possible f-string without an `f` prefix. 2024-03-01 09:30:04 -08:00
configure-rabbitmq configure-rabbitmq: Remove use of sudo. 2022-04-19 12:36:31 -07:00
create-database create-database: Treat "zulip" db without "zerver_messages" as empty. 2024-03-08 10:10:19 -08:00
create-db.sql create-db: Default dbuser and dbname to zulip. 2021-05-26 17:19:11 -07:00
create-pgroonga.sql pgroonga: Remove now-unnecessary 'GRANT USAGE' statement. 2023-06-23 14:40:27 -07:00
flush-memcached memcached: Switch from pylibmc to python-binary-memcached. 2020-08-06 12:51:14 -07:00
generate-rabbitmq-cookie CVE-2021-43799: Set a secure Erlang cookie. 2022-01-25 02:13:53 +00:00
generate-self-signed-cert generate-self-signed-cert: Remove RANDFILE. 2022-02-25 14:49:07 -08:00
generate_secrets.py black: Reformat with Black 23. 2023-02-02 10:40:13 -08:00
initialize-database scripts: Switch to stop-server/restart-server. 2022-03-21 16:33:28 -07:00
install install: Use a period at end of root error message. 2021-06-23 08:42:46 -07:00
pgroonga-config pgroonga: Do not attempt to configure pgroonga without a database. 2023-09-22 11:45:00 -07:00
reindex-textual-data scripts: Help mypy resolve the psycopg2.connect overload. 2022-08-30 17:36:21 -07:00
restore-backup restore-backup: Provide flags to leave settings.py and zulip.conf as-is. 2022-07-20 12:35:51 -07:00
setup-certbot install-shellcheck: Upgrade ShellCheck to 0.9.0. 2023-01-04 14:01:34 -08:00
sha256-file-to puppet: Add a sha256_file_to. 2023-02-10 15:53:10 -08:00
sha256-tarball-to scripts: Pass --retry 3 to curl. 2022-11-08 08:07:36 -08:00
terminate-psql-sessions
upgrade-postgresql install: Support PostgreSQL 16. 2023-12-23 14:57:12 -08:00