Tearleads

principal_directory_bindings API Postgres table

First signed directory citation of each group head, retained after group deletion.

Declared in packages/api-shared/src/schema/principalDirectoryBindings.ts

Columns

  • iduuid
    • primary key
    • not null
    • default gen_random_uuid()

    Surrogate database primary key.

  • organization_iduuid
    • not null

    Organization whose signed directory cites the group head.

  • organization_versionbigint
    • not null

    Version of the organization principal state whose directory first cited this group head.

  • organization_state_hashtext
    • not null

    State hash of that organization state. Joins to principalStates.stateHash.

  • group_iduuid
    • not null

    Group the directory cites.

  • group_versionbigint
    • not null

    Version of the cited group principal state.

  • group_state_hashtext
    • not null

    State hash of the cited group principal state. Unique per organization and group, so a later citation of the same head keeps the first row.

Indexes

  • principal_directory_bindings_head_idx(organization_id, group_id, group_state_hash)
    • unique
  • principal_directory_bindings_lookup_idx(organization_id, group_id, organization_version)