Skip to content

Schema reference

This page is the one index of the whole read surface. It names every relation and routine granted to the authenticated role and, for each, points to the migration that defines it and to the section of read contracts that gives its semantics. It never restates a column list — the migration is the shape, read-contract.md is the meaning, and this page is the map between them.

A consumer scopes any feature that reads Platform evidence by enumerating from this page and the migrations it points to, never from the fields the consumer application already reads (ADR-0019).

tests/test_schema_reference_contract.py fails when a surface granted to authenticated is missing from the table below, so a new read surface cannot ship undocumented.

Semantics every consumer reads first

Before scoping a filter or a column, read these notes in read-contract.md. They are the difference between a correct list and a silently wrong one.

Views

Web classification filters and detail provenance are defined in 20260913120000_web_classification_filters.sql. Read Web classification filters for source scope, the closed catalog, and expiry semantics.

Company role and contact-availability filters and detail fields are defined in 20260912120000_company_contact_availability.sql. Read Company contact availability for the bounded role vocabulary and three-state contact meanings.

The auditor-firm filter and detail evidence are implemented in 20260911120000_current_registry_auditors.sql. Read Current registry auditors before using the identifiers or interpreting an empty collection.

The cvrs filter on search and facet counts is defined in 20261001120000_company_cvr_set_filter.sql. It is published through company_search_filter_contract(); it does not add a list table or a new read surface.

Surface Purpose Migration Semantics
active_companies Current (not ended) companies for cross-company filtering, including source Danish main_industry_text (null when absent). 20260930120000_company_industry_text.sql Implemented view surface
active_companies_financial_snapshot Active companies joined to their single most recent parsed accounting period. 20260720170000_financial_read_contract.sql Implemented view surface
financial_reports_latest Newest publication per accounting period, correction-resolved. 20260719200000_financial_reports.sql Implemented view surface
financial_key_figures Derived nøgletal (one row per parsed report) reproducing proff.dk's figures. 20260812140000_full_financial_statement.sql Implemented view surface
company_participants One row per current registry role across the whole population — leadership at scale. 20260901000000_company_participants_contract.sql Bulk participants contract
company_web_presence Current best eligible web signal per company and kind; website rows require bound accepted ownership evidence, while historical observations remain stored. 20260930122000_historical_website_selection.sql Web enrichment
company_web_contact Every distinct company-level contact value read off a website. 20260814200000_web_read_contract.sql Web enrichment
company_source_signals Source-qualified organic/AI Mode observations with exact JSON quote locators; separate from acquired pages and canonical relationships. 20260908190000_goal_search.sql Search source signals
company_profile_signals Current best-supported profile observation per field, with evidence. 20260815140000_web_company_profile_signal.sql Web signals
company_entity_mentions Companies a page names as customer, supplier, partner, or competitor — a mention, not a resolved edge. 20260815150000_web_entity_mention.sql Entity mentions and discovered relationships

Routines

Surface Purpose Migration Semantics
search_companies Product-shaped company search with source Danish main_industry_text (null when absent), registry municipality_name (null when absent), the status_group Facet token, Facet and Filterable fields, descending financial/employee orders, keyset pages, and bound cursors. 20261003120000_company_search_row_municipality_status_group.sql Company-search contract
company_facet_counts Exact disjunctive counts for the four original groups and company form, website, email, phone, advertising protection, holding activity, group roles, and financial classes, plus the exact target-group total. Financial ranges use a set-based current-financial pass. 20260924120000_complete_company_facet_index.sql Company-Facet contract
company_form_vocabulary Collected CVR company-form codes and disclosed Danish short names, including ended-company codes. 20260923120000_company_form_vocabulary.sql Company-form vocabulary
company_auditor_vocabulary Current registry auditor-firm identifiers and disclosed names. 20260911120000_current_registry_auditors.sql Current registry auditors
company_search_filter_contract The self-describing filter contract: every accepted p_filters key, each key's value domain, shape, and allowed-value vocabulary. 20260906130000_company_search_filter_contract.sql Self-describing surfaces
company_detail The single company-selection surface: current detail, source history, relationship history with the counterpart's current name, and derived financial metrics.ebitda. 20261003121000_relationship_counterpart_name.sql Company-detail contract
company_facts_as_of What the source stated about a company on a given date. 20260815102000_company_detail_rpc.sql Company-detail contract
production_unit_facts_as_of What the source stated about a production unit on a given date. 20260815111000_company_detail_production_units.sql Company-detail contract
participant_facts_as_of What the source stated about a participant on a given date. 20260815121000_company_detail_participants.sql Company-detail contract
company_graph_neighbors Competitor traversal: CVR anchors in, current observed competitor-of / customer-of neighbours out. 20260902000000_company_graph_neighbor_contract.sql Graph-neighbor contract
person_read_contract Live person filter vocabulary, response fields, role/contact states and pagination rules. 20260925120000_person_read_contract.sql Person reads
accepted_prospect_evidence_contract Live Hybrid filter rules, including municipality and keyword exclusion evidence and matching, ranking versions, card fields and evidence states. 20260927100000_hybrid_policy_exclusions.sql Accepted-prospect evidence
search_people Registry person search, current-role filters, exact total and version-bound pagination. 20260925120000_person_read_contract.sql Person reads
person_profile Registry person deep link with role history, separate website claims and permitted contact states. 20260925120000_person_read_contract.sql Person reads
accepted_prospect_evidence Direct CVR lookup for current Hybrid evidence in a saved context and a permitted selected-person reference. 20260927100000_hybrid_policy_exclusions.sql Accepted-prospect evidence
hybrid_similar_companies Reciprocal-rank fusion over semantic and structured similarity for the Prospect queue. 20260927100000_hybrid_policy_exclusions.sql Hybrid-similarity contract

What is deliberately not here

entity_nodes, entity_facts, and entity_relationships, and every base table, keep row-level security with no policies and are not granted. They are read only through the routines above. Operator-facing views (financial_metric_coverage, ingestion_staleness, and the other ingestion tables) are not consumer surfaces and carry no grant. company_registry_detail was removed on purpose (ADR-0017, ADR-0019); widen search_companies through its Filterable field list instead of reviving a wide registry view. As of #630 that list spans registry facts, financial figures and key ratios, and web-presence flags — see Filterable fields: registry and the financial and web-presence sections below it.

Gross-profit comparisons

search_companies, company_facet_counts, company_search_filter_contract, and company_detail include the growth contract from 20260910120000_gross_profit_growth.sql. See growth semantics and endpoint evidence.

Classification evidence

The private company_control_periods, company_control_coverage, and company_financial_class_projection tables support ADR-0027. They have RLS and no consumer grants. company_detail exposes their source evidence through current_detail.classifications. The final routine definitions are in 20260922120000_company_financial_classes.sql. See classification semantics.