Skip to main content
The platform db group manages the master database schema, and platform registry inspects the live registry served to validators. Their group help is Database helpers and Registry helpers respectively (base/src/platform_network/cli_app/main.py:62-63).

Database commands

Applies all pending Alembic migrations, upgrading the master database to head (base/src/platform_network/cli_app/main.py:922-927). The runtime database URL comes from database.url in your config (base/src/platform_network/cli_app/main.py:926-927).
The underlying helper upgrades to revision head by default (base/src/platform_network/db/migrations.py:21-26). A matching downgrade helper targets -1 (one revision back) but is not exposed as a CLI command (base/src/platform_network/db/migrations.py:29-34).
Generates a new Alembic revision with autogenerate=True from the current models (base/src/platform_network/cli_app/main.py:930-940).

Registry command

Fetches the active challenge registry from validator.registry_url and prints it as indented JSON (base/src/platform_network/cli_app/main.py:943-948).

Database tables

The master schema is defined as SQLAlchemy models (base/src/platform_network/db/models.py). platform db migrate creates and maintains these tables.

Challenge status values

The challenges.status column uses the ChallengeStatus enum (base/src/platform_network/db/models.py:30-36).
New challenges default to draft and must be activated before validators evaluate them (base/src/platform_network/db/models.py:78-79). See the Challenge CLI for activate / deactivate.

Database architecture

The schema and tables these migrations create and maintain.

Proxy API

The public /v1/registry read this CLI mirrors.