Aller au contenu

Table: federation_peers

Ce contenu n’est pas encore disponible dans votre langue.

Referenced by:

ColumnTypeNullableNotes
iduuidnoDefault gen_random_uuid()
instance_urltextno-
display_nametextno-
instance_public_keytextno-
trust_tiertextnoDefault 'connected'::text
encryption_policytextnoDefault 'plaintext'::text
enabledbooleannoDefault true
statustextnoDefault 'connected'::text
handshake_attimestampnoDefault now()
handshake_by_user_refbigintno-
last_seen_attimestampyes-
notestextnoDefault ''::text
share_in_visible_listbooleannoDefault false
created_attimestampnoDefault now()
updated_attimestampnoDefault now()
capabilitiesjsonbnoDefault '[]'::jsonb. Capabilities both instances support: the intersection agreed when they paired, as a JSON array of capability strings. Unknown strings are allowed; code acts only on the ones it knows (ADR 0049). A listed capability records what was negotiated, not proof that the feature works end to end (#1526).
capabilities_negotiated_attimestampyesWhen the pairing handshake completed with a capability exchange. NULL means the peer was paired before capabilities were negotiated and should be re-paired. An empty array with a timestamp means negotiation happened and found nothing in common.
  • CONSTRAINT federation_peers_encryption_policy_check CHECK ((encryption_policy = ANY (ARRAY['plaintext'::text, 'e2e-encrypted'::text])))
  • CONSTRAINT federation_peers_status_check CHECK ((status = ANY (ARRAY['pending_outbound'::text, 'pending_inbound'::text, 'connected'::text])))
  • CONSTRAINT federation_peers_trust_tier_check CHECK ((trust_tier = ANY (ARRAY['connected'::text, 'directory-listed'::text, 'auto-sync'::text])))

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.federation_peers (
id uuid DEFAULT gen_random_uuid() NOT NULL,
instance_url text NOT NULL,
display_name text NOT NULL,
instance_public_key text NOT NULL,
trust_tier text DEFAULT 'connected'::text NOT NULL,
encryption_policy text DEFAULT 'plaintext'::text NOT NULL,
enabled boolean DEFAULT true NOT NULL,
status text DEFAULT 'connected'::text NOT NULL,
handshake_at timestamp with time zone DEFAULT now() NOT NULL,
handshake_by_user_ref bigint NOT NULL,
last_seen_at timestamp with time zone,
notes text DEFAULT ''::text NOT NULL,
share_in_visible_list boolean DEFAULT false NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL,
capabilities jsonb DEFAULT '[]'::jsonb NOT NULL,
capabilities_negotiated_at timestamp with time zone,
CONSTRAINT federation_peers_encryption_policy_check CHECK ((encryption_policy = ANY (ARRAY['plaintext'::text, 'e2e-encrypted'::text]))),
CONSTRAINT federation_peers_status_check CHECK ((status = ANY (ARRAY['pending_outbound'::text, 'pending_inbound'::text, 'connected'::text]))),
CONSTRAINT federation_peers_trust_tier_check CHECK ((trust_tier = ANY (ARRAY['connected'::text, 'directory-listed'::text, 'auto-sync'::text])))
);

See the schema overview for context.