1 contributor
53 lines | 1.54kb

Table: data_workers

Stores worker/source definitions for collected external data.

Columns

Column Type Null Default Notes
worker_id TEXT no none Worker identifier. Primary key.
worker_type TEXT no none Worker type, for example dhcp or mdns.
name TEXT no '' Human-readable name.
status TEXT no 'active' Worker lifecycle state.
source TEXT no '' Source endpoint/file.
last_run_at TEXT yes NULL Last successful collection timestamp.
notes TEXT no '' Operator notes.
created_at TEXT no none ISO UTC creation timestamp.
updated_at TEXT no none ISO UTC update timestamp.

Keys And Indexes

  • Primary key: worker_id
  • Lookup index: idx_data_workers_type_status on (worker_type, status)

Relationships

Referenced by:

  • dhcp_leases.worker_id
  • mdns_observations.worker_id

Seed Rows

  • dhcp-router, type dhcp
  • mdns-listener, type mdns

Definition

CREATE TABLE IF NOT EXISTS data_workers (
    worker_id TEXT PRIMARY KEY,
    worker_type TEXT NOT NULL,
    name TEXT NOT NULL DEFAULT '',
    status TEXT NOT NULL DEFAULT 'active',
    source TEXT NOT NULL DEFAULT '',
    last_run_at TEXT,
    notes TEXT NOT NULL DEFAULT '',
    created_at TEXT NOT NULL,
    updated_at TEXT NOT NULL
);

CREATE INDEX IF NOT EXISTS idx_data_workers_type_status
ON data_workers(worker_type, status);