Herds
Table for storing team metadata
| Column Name | Data Type | Constraints |
|---|---|---|
| id | bigint | NOT NULL |
| inserted_at | timestamp with time zone | DEFAULT timezone('utc'::text, now()) NOT NULL |
| slug | text | NOT NULL |
| description | text | NOT NULL |
| is_public | boolean | DEFAULT false NOT NULL |
| location | extensions.geography(Point,4326) | |
| auto_delete_media_with_humans | boolean | |
| auto_delete_media_with_no_tracks | boolean | |
| localization_id | bigint | FK -> localizations |
| media_max_storage_bytes | bigint | NULL = unlimited, CHECK >= 0 |
| media_max_daily_allowed_uploads_bytes | bigint | NULL = unlimited, CHECK >= 0 |
| document_expiry_warning_period_days | integer | Member-editable via herds.write |
Usage snapshots: Herd_media_usage.
EarthRanger and video credentials moved to providers; see Providers.
Security Policies (RLS)
RLS enabled. Herd scope: Herd id is herds.id.
| Operation | has_herd_ability ability key | Other paths |
|---|---|---|
| SELECT | herds.read | Device API key whose devices.herd_id matches |
| INSERT | — | Platform superadmin only (is_platform_superadmin) |
| UPDATE | herds.write | Only document_expiry_warning_period_days may change (herds_update_guard trigger); every other column is superadmin-only |
| DELETE | — | Platform superadmin only |
Platform superadmin: FOR ALL bypass where defined.