TerraHawk Supabase data model v1

TerraHawk Supabase data model v1 An entity-relationship diagram generated by Archify. Topology Telemetry Operations Vision (parked) Auth (existing) systems · Entity · Topology systems PK id text name text kind text location text created_at timestamptz devices · Entity · Topology devices PK id text FK system_id text kind text firmware text online boolean last_seen timestamptz created_at timestamptz readings · raw · 7–14 d · Entity · Telemetry readings PK id bigint ts timestamptz FK device_id text key text value double precision received_at timestamptz readings_5m · 5-min aggregates · Entity · Telemetry readings_5m PK bucket timestamptz PKFK device_id text PK key text min double precision avg double precision max double precision n integer latest · VIEW over readings · Entity · Telemetry latest device_id text key text ts timestamptz value double precision events · Entity · Operations events PK id bigint ts timestamptz FK device_id text kind text severity text payload jsonb commands · Entity · Operations commands PK id bigint ts timestamptz FK device_id text action text params jsonb source text FK issued_by uuid status text acked_at timestamptz result jsonb detections · PARKED · Entity · Vision (parked) detections PK id bigint ts timestamptz FK system_id text source text label text confidence real bbox jsonb FK image_id uuid images · PARKED · Storage index · Entity · Vision (parked) images PK id uuid ts timestamptz FK system_id text FK device_id text UK storage_path text keep boolean profiles · id = auth.users.id · Entity · Auth (existing) profiles PK id uuid display_name text avatar_url text created_at timestamptz updated_at timestamptz user_roles · Entity · Auth (existing) user_roles PK id uuid FK user_id uuid role app_role created_at timestamptz subscribers · Entity · Auth (existing) subscribers PK id uuid UK email text FK user_id uuid subscribed boolean created_at timestamptz belongs to measured by aggregates raised by targets issued by observed in from frame captured in camera grants linked user Legend PK Primary key FK Foreign key UK Unique key One Many Optional