Files
OmniOilPersonal/services/backend-api/migrations/20260511000000_opcua_scan_results.sql
Wilman Yesid Farfan Diaz 1346e1ab0a feat(edge): OPC UA node scanner (v0.3.0)
- shared-lib: Add OpcUaScannedNode and OpcUaScanResult types to mqtt_messages
- edge-agent: Bump version 0.2.0 → 0.3.0
- edge-agent: Add optional opcua dep + opcua-support feature flag
- edge-agent/drivers/opc_ua: Add browse_nodes() with cfg-gated real impl
- edge-agent/mqtt_listener: Add ScanOpcUa command variant and MQTT handler
- edge-agent/main: Handle AgentCommand::ScanOpcUa, publish results to MQTT
- backend-api: Migration 20260511000000_opcua_scan_results.sql
- backend-api/handlers/edge_devices: trigger_opcua_scan + get_opcua_scan_result
- backend-api/main: MQTT handler for omnioil/opcua-scan/+, add API routes
- build-orchestrator: Enable opcua-support feature when building agent
- frontend-admin/variables-api: OPC UA scanner API types and functions
- frontend-admin/DeviceConfigModal: OPC UA node browser UI with polling
- .env.example.*: AGENT_LATEST_VERSION 0.2.0 → 0.3.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-11 21:14:37 -05:00

17 lines
807 B
SQL

-- OPC UA scan results: stores the output of node discovery scans
-- triggered from the admin panel to help users find available variables.
CREATE TABLE IF NOT EXISTS opcua_scan_results (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
device_id UUID NOT NULL,
project_id UUID NOT NULL,
status VARCHAR(20) NOT NULL DEFAULT 'pending', -- pending | completed | failed
result JSONB,
error_message TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
expires_at TIMESTAMPTZ NOT NULL DEFAULT NOW() + INTERVAL '15 minutes'
);
CREATE INDEX IF NOT EXISTS idx_opcua_scan_device ON opcua_scan_results(device_id);
CREATE INDEX IF NOT EXISTS idx_opcua_scan_project ON opcua_scan_results(project_id);
CREATE INDEX IF NOT EXISTS idx_opcua_scan_expires ON opcua_scan_results(expires_at);