db command
Setup and manage a Tethys database.
usage: tethys db [-h] [-d DB_ALIAS] [-n USERNAME] [-p PASSWORD]
[-N SUPERUSER_NAME] [-P SUPERUSER_PASSWORD]
[--portal-superuser-name PORTAL_SUPERUSER_NAME]
[--portal-superuser-email PORTAL_SUPERUSER_EMAIL]
[--portal-superuser-password PORTAL_SUPERUSER_PASSWORD] [-y]
{init,start,stop,status,create,migrate,createsuperuser,configure,sync,purge}
Positional Arguments
- command
Possible choices: init, start, stop, status, create, migrate, createsuperuser, configure, sync, purge
- Performs operations on the Tethys Database.
init - Creates a new, locally running PostgreSQL database server.
start - Starts a local PostgreSQL database server.
stop - Stops a local PostgreSQL database server.
status - Gets the current status of a local PostgreSQL database server.
create - Creates the Tethys Portal database on a PostgreSQL database server configured in the portal-config.yml (this could be local or remote).
migrate - Runs migrations on the Tethys Portal database.
createsuperuser - Creates a Tethys Portal superuser account.
- configure - A shortcut for running: init, start, create, migrate, and createsuperuser (for PostgreSQL and SQLite databases).
Note: if the DIR parameter is not defined in your DATABASES.default configuration in portal_config.yml then the init and start commands are skipped. If the database
ENGINE
is configured to useSQLite
then only the migrate and createsuperuser commands are run.
sync - Syncs the Tethys Portal database with installed apps and extensions.
purge - Stops database server and removes the database file (SQLite) or the database cluster directory (locally running PostgreSQL).
Named Arguments
- -d, --database
Name of the database options from portal_config.yml to use (e.g. 'default').
Default: "default"
- -n, --username
Name of database user to add to database when creating.
Default: "tethys_default"
- -p, --password
Password for the database user.
Default: "pass"
- -N, --superuser-name
Name of database super user to add to database when creating.
Default: "tethys_super"
- -P, --superuser-password
Password for the database super user.
Default: "pass"
- --portal-superuser-name, --pn
Name for the Tethys portal super user.
Default: "admin"
- --portal-superuser-email, --email, --pe
Email of the Tethys portal super user.
Default: ""
- --portal-superuser-password, --pp
Password for the Tethys portal super user.
Default: "pass"
- -y, --yes
Do not ask for confirmation. Applies only to the configure and the purge commands.
Default: False