Table: collections
Ce contenu n’est pas encore disponible dans votre langue.
Connected to
Section titled “Connected to”This table references:
Referenced by:
collection_acls: columncollection_idcollection_field_value: columncollection_idcollection_field_value_history: columncollection_idcollection_posts: columncollection_idcollection_resources: columncollection_id
Columns
Section titled “Columns”| Column | Type | Nullable | Notes |
|---|---|---|---|
id | uuid | no | Default gen_random_uuid() |
owner_user_ref | bigint | no | - |
name | text | no | - |
description | text | no | Default ''::text |
visibility | text | no | Default 'private'::text |
membership | text | no | Default 'manual'::text |
expires_at | timestamp | yes | - |
purpose | text | yes | - |
origin_server_id | uuid | yes | - |
created_at | timestamp | no | Default now() |
updated_at | timestamp | no | Default now() |
search_text | tsvector | yes | - |
smart_query | text | yes | The search that produced this collection, kept for display. It is never used to work out membership, and the collection doesn’t update itself when new matches appear. |
deleted_at | timestamp | yes | - |
deleted_reason | text | yes | - |
deleted_by_user_ref | bigint | yes | - |
cover_asset_id | uuid | yes | References assets(id). Curator-chosen cover picture: any asset the curator is allowed to show, not necessarily a member. NULL means compose a mosaic from the members. When the chosen cover isn’t viewable for a reader, the mosaic is shown instead, never a blank. If the asset is deleted, the collection reverts to its mosaic. It names an asset on this server, so it’s local to this instance. |
featured_cover_asset_id | uuid | yes | References assets(id). Curator-chosen cover for the featured rail specifically, because the rail card (890:500) and the collection card (4:3) are different shapes. NULL means fall back to cover_asset_id, then to the derived cover, each re-checked for the viewer so a withheld picture falls back instead of rendering blank. Reverts if the asset is deleted; local to this instance. |
featured_cover_focal_x | double | yes | Horizontal focal point for the featured rail’s 890:500 crop, as a fraction of the picture’s width (0 = left, 1 = right). Maps to CSS object-position. NULL means centre, stored separately from an explicit 0.5 so resetting clears the value. Must be NULL or in 0..1 together with featured_cover_focal_y. |
featured_cover_focal_y | double | yes | Vertical focal point for the featured rail’s 890:500 crop, as a fraction of the picture’s height (0 = top, 1 = bottom). Works like featured_cover_focal_x. |
cover_focal_x | double | yes | Horizontal focal point for the collection card’s 4:3 crop, as a fraction of the picture’s width (0 = left, 1 = right). The 4:3 card is the only collection surface that crops this picture; the rail uses its own focal point. Maps to CSS object-position; NULL means centre, distinct from an explicit 0.5. Must be NULL or in 0..1 together with cover_focal_y, and is cleared when the cover changes without new framing. Chosen against the original picture, so render it on an uncropped (contain) preview, not the square col thumbnail. |
cover_focal_y | double | yes | Vertical focal point for the collection card’s 4:3 crop, as a fraction of the picture’s height (0 = top, 1 = bottom). Works like cover_focal_x. |
featured_cover_zoom | double | yes | How much the featured rail’s crop is tightened: the crop window is the fitted window divided by this value, so 1 is the fit and 2 shows a quarter of the area. NULL means fit (what clients unaware of zoom render), stored separately from an explicit 1 so resetting clears it. Limited to 1..4, the range the stored preview sizes support. |
cover_zoom | double | yes | How much the collection card’s 4:3 crop is tightened. Separate from featured_cover_zoom because the two shapes need different framing; works the same way (NULL means fit, range 1..4). Chosen against the original picture, like the focal point. |
Constraints
Section titled “Constraints”CONSTRAINT collections_cover_focal_check CHECK ((((cover_focal_x IS NULL) AND (cover_focal_y IS NULL)) OR (((cover_focal_x >= (0)::double precision) AND (cover_focal_x <= (1)::double precision)) AND ((cover_focal_y >= (0)::double precision) AND (cover_focal_y <= (1)::double precision)))))CONSTRAINT collections_cover_zoom_check CHECK (((cover_zoom IS NULL) OR ((cover_zoom >= (1)::double precision) AND (cover_zoom <= (4)::double precision))))CONSTRAINT collections_featured_cover_focal_check CHECK ((((featured_cover_focal_x IS NULL) AND (featured_cover_focal_y IS NULL)) OR (((featured_cover_focal_x >= (0)::double precision) AND (featured_cover_focal_x <= (1)::double precision)) AND ((featured_cover_focal_y >= (0)::double precision) AND (featured_cover_focal_y <= (1)::double precision)))))CONSTRAINT collections_featured_cover_zoom_check CHECK (((featured_cover_zoom IS NULL) OR ((featured_cover_zoom >= (1)::double precision) AND (featured_cover_zoom <= (4)::double precision))))CONSTRAINT collections_membership_check CHECK ((membership = ANY (ARRAY['manual'::text, 'query'::text, 'hybrid'::text])))CONSTRAINT collections_visibility_check CHECK ((visibility = ANY (ARRAY['private'::text, 'org-only'::text, 'followers'::text, 'explicit-share'::text, 'public'::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.collections ( id uuid DEFAULT gen_random_uuid() NOT NULL, owner_user_ref bigint NOT NULL, name text NOT NULL, description text DEFAULT ''::text NOT NULL, visibility text DEFAULT 'private'::text NOT NULL, membership text DEFAULT 'manual'::text NOT NULL, expires_at timestamp with time zone, purpose text, origin_server_id uuid, created_at timestamp with time zone DEFAULT now() NOT NULL, updated_at timestamp with time zone DEFAULT now() NOT NULL, search_text tsvector, smart_query text, deleted_at timestamp with time zone, deleted_reason text, deleted_by_user_ref bigint, cover_asset_id uuid, featured_cover_asset_id uuid, featured_cover_focal_x double precision, featured_cover_focal_y double precision, cover_focal_x double precision, cover_focal_y double precision, featured_cover_zoom double precision, cover_zoom double precision, CONSTRAINT collections_cover_focal_check CHECK ((((cover_focal_x IS NULL) AND (cover_focal_y IS NULL)) OR (((cover_focal_x >= (0)::double precision) AND (cover_focal_x <= (1)::double precision)) AND ((cover_focal_y >= (0)::double precision) AND (cover_focal_y <= (1)::double precision))))), CONSTRAINT collections_cover_zoom_check CHECK (((cover_zoom IS NULL) OR ((cover_zoom >= (1)::double precision) AND (cover_zoom <= (4)::double precision)))), CONSTRAINT collections_featured_cover_focal_check CHECK ((((featured_cover_focal_x IS NULL) AND (featured_cover_focal_y IS NULL)) OR (((featured_cover_focal_x >= (0)::double precision) AND (featured_cover_focal_x <= (1)::double precision)) AND ((featured_cover_focal_y >= (0)::double precision) AND (featured_cover_focal_y <= (1)::double precision))))), CONSTRAINT collections_featured_cover_zoom_check CHECK (((featured_cover_zoom IS NULL) OR ((featured_cover_zoom >= (1)::double precision) AND (featured_cover_zoom <= (4)::double precision)))), CONSTRAINT collections_membership_check CHECK ((membership = ANY (ARRAY['manual'::text, 'query'::text, 'hybrid'::text]))), CONSTRAINT collections_visibility_check CHECK ((visibility = ANY (ARRAY['private'::text, 'org-only'::text, 'followers'::text, 'explicit-share'::text, 'public'::text]))));See the schema overview for context.