Module migrations

Module migrations 

Source
Expand description

Embedded SQL schema migrations.

All tables use IF NOT EXISTS for idempotent re-execution. The schema is applied as a single transaction via run on every startup, so adding new tables or indices is a no-op when they already exist.

§Tables

TablePurpose
reflectorsRegistry of discovered D-STAR reflectors (Tier 1).
activity_logTimestamped observations of callsign activity (Tier 2).
connected_nodesSnapshot of nodes currently linked to a reflector.
streamsCaptured voice transmissions with audio and metadata (Tier 3).

§Relationships

activity_log.reflector and connected_nodes.reflector both reference reflectors.callsign via foreign key. streams.reflector is intentionally not foreign-keyed so that streams captured from transiently-seen reflectors survive registry cleanup.

Constants§

SCHEMA_SQL 🔒
SQL statements executed in order to bring the schema up to date.

Functions§

run 🔒
Executes the embedded schema DDL against the database.