Table: assets
Ce contenu n’est pas encore disponible dans votre langue.
Connected to
Section titled “Connected to”This table references:
asset_types(ref) via columnasset_typestorage_objects(hash) via columnfile_hashworkflow_states(id) via columnstate_idteams(id) via columnteam_id
Referenced by:
asset_alternates: columnasset_idasset_companions: columnasset_idasset_embedding_d768: columnasset_idasset_field_value: columnasset_idasset_field_value_history: columnasset_idasset_subtitle_tracks: columnasset_idasset_tag: columnasset_idasset_visual_embedding: columnasset_idcollection_resources: columnasset_idcollections: columnscover_asset_id,featured_cover_asset_idcreative_lineage: columnsderivative_asset_id,source_asset_idextraction_failure: columnasset_idpost_assets: columnasset_idposts: columnscover_asset_id,cover_thumbnail_asset_idsearch_feedback: columnhit_asset_idteams: columnhero_asset_id
Columns
Section titled “Columns”| Column | Type | Nullable | Notes |
|---|---|---|---|
id | uuid | no | Default gen_random_uuid() |
title | text | no | Default ''::text |
description | text | no | Default ''::text |
asset_type | bigint | no | References asset_types(ref) |
owner_user_ref | bigint | yes | - |
status | text | no | Default 'active'::text |
file_hash | text | yes | References storage_objects(hash) |
file_extension | text | yes | - |
file_size_bytes | bigint | yes | - |
access | integer | no | Default 0 |
is_transcoding | boolean | no | Default false |
metadata | jsonb | no | Default '{}'::jsonb |
origin_server_id | uuid | yes | - |
created_at | timestamp | no | Default now() |
updated_at | timestamp | no | Default now() |
deleted_at | timestamp | yes | - |
search_text | tsvector | yes | - |
state_id | uuid | yes | References workflow_states(id) |
team_id | uuid | yes | References teams(id) |
processing_status | text | no | Default 'ready'::text |
thumbhash | bytea | yes | - |
processing_attempts | integer | no | Default 0 |
processing_error | text | yes | - |
processing_started_at | timestamp | yes | - |
processing_finished_at | timestamp | yes | - |
sensitivity | text | no | Default 'public'::text. Sensitivity tier: public, team, restricted or embargo. The routes that deliver an asset’s content check it (see Security). In federation, the receiving instance’s encryption check reads it for assets; the sender-side refusal isn’t wired to it yet (#1525). New assets start public. |
page_count | integer | yes | Total page count for paginated assets (PDF today), filled in by the metadata pipeline. NULL means either not paginated or not extracted yet; clients treat both the same way. |
deleted_reason | text | yes | - |
deleted_by_user_ref | bigint | yes | - |
mature | boolean | no | Default false |
ai_provenance | text | yes | The maker’s declaration about generative AI (ADR 0094): none, assisted (AI used in part) or generated (substantially AI-generated). NULL means undeclared, which is not the same as none; older rows stay NULL so nobody is credited with a declaration they didn’t make. It’s a filter a viewer can apply to their own feed, never a gate: nothing about the work is withheld from others because of it. Metadata extraction may later corroborate assisted or generated on an undeclared work, but can never establish none. Not carried in federated messages yet; ADR 0094 records how it would be. |
Constraints
Section titled “Constraints”CONSTRAINT assets_ai_provenance_check CHECK (((ai_provenance IS NULL) OR (ai_provenance = ANY (ARRAY['none'::text, 'assisted'::text, 'generated'::text]))))CONSTRAINT assets_processing_status_check CHECK ((processing_status = ANY (ARRAY['pending'::text, 'processing'::text, 'ready'::text, 'failed'::text])))CONSTRAINT assets_sensitivity_check CHECK ((sensitivity = ANY (ARRAY['public'::text, 'team'::text, 'restricted'::text, 'embargo'::text])))CONSTRAINT assets_status_check CHECK ((status = ANY (ARRAY['draft'::text, 'active'::text, 'archived'::text])))
Full DDL
Section titled “Full DDL”This is the table’s CREATE TABLE statement. Constraints added with separate ALTER TABLE statements, including foreign-key ON DELETE rules, and indexes are defined elsewhere in the dump; see the complete app/schema.sql.
CREATE TABLE public.assets ( id uuid DEFAULT gen_random_uuid() NOT NULL, title text DEFAULT ''::text NOT NULL, description text DEFAULT ''::text NOT NULL, asset_type bigint NOT NULL, owner_user_ref bigint, status text DEFAULT 'active'::text NOT NULL, file_hash text, file_extension text, file_size_bytes bigint, access integer DEFAULT 0 NOT NULL, is_transcoding boolean DEFAULT false NOT NULL, metadata jsonb DEFAULT '{}'::jsonb NOT NULL, origin_server_id uuid, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, deleted_at timestamp with time zone, search_text tsvector, state_id uuid, team_id uuid, processing_status text DEFAULT 'ready'::text NOT NULL, thumbhash bytea, processing_attempts integer DEFAULT 0 NOT NULL, processing_error text, processing_started_at timestamp with time zone, processing_finished_at timestamp with time zone, sensitivity text DEFAULT 'public'::text NOT NULL, page_count integer, deleted_reason text, deleted_by_user_ref bigint, mature boolean DEFAULT false NOT NULL, ai_provenance text, CONSTRAINT assets_ai_provenance_check CHECK (((ai_provenance IS NULL) OR (ai_provenance = ANY (ARRAY['none'::text, 'assisted'::text, 'generated'::text])))), CONSTRAINT assets_processing_status_check CHECK ((processing_status = ANY (ARRAY['pending'::text, 'processing'::text, 'ready'::text, 'failed'::text]))), CONSTRAINT assets_sensitivity_check CHECK ((sensitivity = ANY (ARRAY['public'::text, 'team'::text, 'restricted'::text, 'embargo'::text]))), CONSTRAINT assets_status_check CHECK ((status = ANY (ARRAY['draft'::text, 'active'::text, 'archived'::text]))));See the schema overview for context.