Database Schema Setup
Once the database service is running, you must create the schema before using the backend. ⚠️ This step is mandatory. The backend will not function until the schema is loaded.
This document explains how to set up the Wallet Backend Database Schema in PostgreSQL.
Schema File
The schema is defined in: schema.pgsql
This file contains:
Table definitions
Indexes
Constraints
Relationships
Applying the Schema
You can either use pgAdmin or psql CLI tool to import. Ensure to create a blank database named uba_wallet_mw before trying one of the options.
Option A - Using pgAdmin
Open pgAdmin at http://localhost:8082
Login with credentials from .
envEmail:
PGADMIN_DEFAULT_EMAILPassword:
PGADMIN_DEFAULT_PASSWORD
Connect to the
PostgresserverRight-click on the database (
uba_beneficiary_mw) → Query ToolLoad and execute
schema.pgsql
Option B - Using psql CLI
Run the following command (from the project root):
docker exec -i <postgres_container_name> psql -U <db-user-name> -d uba_wallet_mw < schema.pgsqlReplace <postgres_container_name> with the container name (Use docker ps to get DB container name).
Verifying Schema
After running the script:
Tables should be visible in pgAdmin under
uba_wallet_mw → Schemas → public → TablesIndexes can be found under each table’s Indexes section
Schema Updates
If schema changes are required:
Update
schema.pgsqlfileRe-run the script as described above
Last updated
