Devices
Table for storing device information including location, type, and configuration
| Column Name | Data Type | Constraints |
|---|---|---|
| id | bigint | NOT NULL |
| inserted_at | timestamp with time zone | DEFAULT timezone('utc'::text, now()) NOT NULL |
| created_by | uuid | NOT NULL |
| herd_id | bigint | NOT NULL |
| name | text | NOT NULL |
| description | text | NOT NULL |
| domain_name | text | |
| altitude | double precision | |
| heading | double precision | |
| location | extensions.geography(Point,4326) | |
| video_publisher_token | text | |
| video_subscriber_token | text | |
| device_type | public.device_type | DEFAULT 'unknown' NOT NULL |
Security Policies (RLS)
This table has Row Level Security (RLS) enabled with the following policies:
- Read Access: Device's own API key OR device API keys within same herd OR users with view role in same herd
- Create/Update/Delete: Users with edit/admin role in same herd