Adventure Labs Logo
Scout Docs

Events

Table for storing individual events sent by devices with media and location data

Column NameData TypeConstraints
idbigintNOT NULL
inserted_attimestamp with time zoneDEFAULT timezone('utc'::text, now()) NOT NULL
updated_attimestamp with time zoneDEFAULT now() NOT NULL
messagetext
media_urltext
file_pathtext
altitudedouble precisionDEFAULT 0 NOT NULL
headingdouble precisionDEFAULT 0 NOT NULL
media_typepublic.media_typeDEFAULT 'image' NOT NULL
device_idbigintNOT NULL
session_idbigint
timestamp_observationtimestamp with time zoneDEFAULT timezone('utc'::text, now()) NOT NULL
is_publicbooleanDEFAULT false NOT NULL
locationextensions.geography(Point,4326)DEFAULT '0101000020E610000000000000000000000000000000000000'
earthranger_urltext
embedded_attimestamp with time zone
segmented_attimestamp with time zone
tagged_attimestamp with time zone
tracked_attimestamp with time zone
thumbnail_file_pathtext
thumbnail_generated_attimestamp with time zone
proxy_file_pathtext
proxy_generated_attimestamp with time zone
processing_blocked_attimestamp with time zone
processing_blocked_reasontext
uploaded_byuuidFK -> users; stamped from auth.uid() on insert by events_uploaded_by, NULL for device and service uploads, immutable afterwards
connectivity_idbigintFK -> connectivity, ON DELETE SET NULL
sensor_pose_idbigintFK -> sensor_poses, ON DELETE SET NULL

Optional producer-set FKs to the nearest connectivity row and sensor pose; not inferred in the database.

Security Policies (RLS)

RLS enabled. Herd scope: Herd from events.device_id → get_herd_id_by_device_id.

Operationhas_herd_ability ability keyOther paths
SELECTmedia.readOwning device API key
INSERTmedia.writeOwning device API key; approved gateway in herd
UPDATEmedia.writeOwning device API key; approved gateway in herd
DELETEmedia.writeOwning device API key

Platform superadmin: FOR ALL bypass where defined.

On this page