Database
DataWarehouse uses PostgreSQL as database backend.
Configuration via environment variables
Name | Secret | Required | Description |
---|---|---|---|
DB_NAME |
no | no | Database name. Defaults to datawarehouse . |
DB_USER |
no | no | Username. Defaults to datawarehouse . |
DB_PASSWORD |
yes | yes | Password. |
DB_HOST |
no | yes | Hostname. |
DB_PORT |
no | no | Port. Defaults to 5432 . |
Schema
The database schema changes frequently. Running the following command it’s possible to get an up to date visualization.
- Podman:
podman exec -it datawarehouse-web ./manage.py graph_models -a > dw.dot
dot -Tx11 dw.dot
- Docker Compose:
docker-compose exec web ./manage.py graph_models -a > dw.dot
dot -Tx11 dw.dot
That will give you a nice diagram of the Django models used in the
app. You might have to install the graphviz
package if you haven’t
already.
Manual review
After running python3 manage.py migrate
, using a production-grade database,
it’s a good practice to check the outcome of it in the schema via:
podman compose exec db pg_dump --schema-only --no-owner --no-privileges -U datawarehouse > db-tables.sql