Skip to content

Who else reads the portal's tables

The database holds four schemas, each migrated only by its owner (ADR 0261, ADR 0449, ADR 0478):

Schema Owner What
public the portal (academy_portal) everything customers’ actions make: organisations, people, courses, payments, the ledger, receipts; and, as the exception, the topic kits, the lab environments and the glossary
platform the admin console (academy_admin) the operator’s tables (settings, prices, legal texts, provider accounts, nodes, maintenance, vouchers, tickets, mail …); the console’s docs/platform-schema.md lists them
admin the admin console (academy_admin) the console’s own: its team, sessions, passkeys, MCP tokens, its log, monitoring
site the website its beta applications and assistant; only where the project’s own website runs (not part of this repository)

Other parts read and write some tables of public directly, with their own database roles. This page lists what they depend on, so a migration doesn’t break them. It is documentation; no other repository reads this file.

The rule: a table or column listed here changes only additively.

  1. Add the new column or table first.
  2. Let the other side switch to it, in its own repository and deploy.
  3. Only then drop or rename the old one.

A drop or rename without that breaks the other side’s deploy, because its grants fail, and its pages.

The admin console (academy_admin_core and academy_admin, repository i3-academy-admin)

Section titled “The admin console (academy_admin_core and academy_admin, repository i3-academy-admin)”
  • Two roles, so neither runs the other’s code (security review #4):

    • academy_admin owns the schemas admin and platform; after the console’s deploy/database-role-split.sql it has no right in public at all, and no BYPASSRLS.
    • academy_admin_core reads and writes the portal’s tables the console’s code names, and has no right on admin. No BYPASSRLS (ADR 0442): on a table with row-level security it sees rows only through its own policies console_core_<right>, made for exactly the rights granted: every organisation’s rows to read (the platform’s view), writing only where the console writes (the platform’s own rows, its own academy, its queue).
  • Where the rights come from: the console’s apps/api/src/core-grants.ts scans its code and writes the list into its deploy/database-role.sql (the portal’s tables) and apps/api/sql/platform-grants.sql (its own platform, with the portal’s academy_platform_reader and the write-backs of academy_platform_writer); test/core-grants.test.ts and test/database-rights.test.ts there fail when code and lists part. Every install.sh --db-setup takes all of the core role’s rights on public away and gives back only the listed ones: a table the console doesn’t name is closed to it. The portal’s deploy grants the console’s roles nothing and sets them no default privileges (it takes back those an earlier deploy set). Never granted, whatever the code names: person_keys, recovery_codes, passkeys, companion_memories, tenant_keys.

  • The portal’s tables it writes (insert, update or delete; the console’s deploy/database-role.sql): audit_log, outbox, tenants, organisation_plans, organisation_addons, organisation_addon_orders, organisation_payments, organisation_restrictions, organisation_run_credits, organisation_switch_requests, sso_connections, platform_conversations, platform_messages, platform_announcements, statements_of_reasons, community_areas, community_moderators, creative_settings, creative_members, creative_trainers, tenant_mascot_blocks, erasure_file_cleanup, erasure_replays, premium_terminations, platform_payments, platform_plans, marketplace_entries, marketplace_payout_runs, marketplace_payouts, marketplace_commission_invoices, marketplace_invoice_numbers, marketplace_term_changes, courses, course_modules, course_point_lots, learning_objects, material_standard_entries, commons_terms, the topic kits (kit_topics, kit_topic_sources, kit_sources, kit_blocks, kit_block_versions, kit_block_competencies, kit_competencies, kit_competency_requires, kit_modules, kit_module_blocks, kit_milestones, kit_milestone_competencies, kit_projects, kit_compositions, kit_composition_items, kit_catalog, kit_catalog_basis, kit_jobs) and the lab’s environments (lab_environments, lab_environment_versions, lab_environment_images, lab_playthroughs, lab_reference_authors) the requests for the protection mode of knowledge sources (knowledge_protection_requests: it decides them and sets tenants.knowledge_protection, ADR 0482) and the review models the platform runs for organisations (knowledge_review_managed, ADR 0486: it sets them; the portal writes only their check and the organisation’s switch). About seventy more it only reads (the list there). Treat every table of public as read by it: renaming or dropping one needs a change in the console first.

  • The portal’s functions and views it calls (they keep their names and signatures, or change additively): console_account_has_password, console_account_has_second_step, console_active_learners, console_course_orders, console_lab_old_own_projects, console_learning_totals, console_learning_weeks, console_live_sessions, console_media_bytes, console_organisation_signups, console_ticket_number; the views ops_ai_budget, ops_ai_connections, ops_database, ops_lab_nodes, ops_lab_starts, ops_maintenance, ops_migrations, ops_queues, ops_restore_checks, ops_table_sizes (the server status and the fleet’s export).

  • The operator’s tables are the console’s (platform): the portal reads them through academy_platform_reader and writes back only the columns of academy_platform_writer; a change to them is the console’s migration, never the portal’s, and no table of public may take one of their names. The sections below describe the columns of some of them as the portal reads them.

  • Platform jobs: the console writes platform_jobs and reads its outcome; the portal’s worker carries them out (platform-jobs.md).

  • Retention of the platform’s data (ADR 0324): the console reads platform_retention_plan (one row per kind: kind, position, period_hours/period_days/period_months, counted_from, notice_days, action, done_by, basis), platform_retention_runs (day for a scheduled run, started_at, finished_at, counts and forecast as JSON objects keyed by kind, failed), account_inactivity_notices (counted only) and accounting_archive (source, source_id, tenant_id, account_id, organisation, record, occurred_at, reason, archived_at; shown to the console’s accounting role alone). It writes none of them.

  • DSA user numbers and contact point (ADR 0331): the console reads dsa_recipient_months (month as the first day in UTC, recipients, outside_eu, unknown, excluded, computed_at), which the portal writes every hour; it never reads dsa_active_recipients (account ids, kept two months). It edits platform_operator.dsa_contact_email (optional; the website falls back to email).

  • Changes of the marketplace’s terms (ADR 0331): while the marketplace is switched on, the console never writes the sale model, the commission (commission_bps, commission_fixed_cents, stripe_fees_by), the holding period, the payout interval, refund_commission or dispute_costs_by of platform_marketplace, nor an exception’s sale_model, commission_bps, commission_fixed_cents in organisation_payments, directly: it inserts a row into marketplace_term_changes.

    Column Type What it is
    tenant_id uuid or null null: the platform’s defaults; else the organisation’s exception
    terms, previous jsonb objects only what changes, by the keys saleModel, commissionBps, commissionFixedCents, providerFeesBy, holdDays, payoutInterval, refundCommission, disputeCostsBy (an exception: the first three; null = the platform’s default again)
    note, requested_by text ≤ 500, the team member’s email
    cancelled_at, cancelled_by the console withdraws a change before it is applied

    One open change per scope (unique index marketplace_term_changes_open). The database refuses effective_at earlier than 15 days after notified_at.

  • Erasures (ADR 0330): the console’s Stuck deletions page reads erasure_file_cleanup (object_key only for its first part, the kind; attempts, queued_at as the first try, last_tried_at, retry_at, ticket_id) and erasure_replays (erasure_id, kind: membership/account/organisation, status: pending/failed/queued, attempts, first_tried_at, last_tried_at, next_try_at, error (a code), job_id, ticket_id). “Retry now” sets retry_at or next_try_at to now and nothing else; the portal never takes from erasure_replays what to erase. Its Erasures page reads organisation_erasures and asks for erase_organisation; it checks that erasure_replays exists (migration 0378) before it does.

  • Declarations to cancel or withdraw (ADR 0277): premium_terminations keeps every declaration sent through the portal’s public form, not only Pro. contract says which (premium, organisation, academy), reference how the person named it, forwarded the organisations it went to as tickets ([{tenantId, ticketId}]). The outcomes forwarded (passed on to the seller) and received (the platform’s team handles it, needs_review) are new; handled_at stays the console’s.

  • Where each legal document comes from (ADR 0280): legal_documents, one row per published document.

    Column Type Required What it is
    key text: imprint, terms, sales, privacy, withdrawal, cookies, acceptableUse, disclaimer yes the document
    source text: termly or own yes (default termly) Termly’s policy, or the operator’s own texts in platform_legal_texts
    termly_id uuid with termly the policy; kept when the source changes to own
    sync boolean yes (default true) Termly: fetched once a day; false keeps the last fetched text until fetched again
    default_language text, two letters yes (default en) own texts: shown to readers whose language has none
    checked_at, check_error timestamptz, text ≤ 500 the console’s last look at Termly, and its error

    No row: not published. The withdrawal information then is the portal’s German template (ADR 0269).

  • The legal texts from Termly (ADR 0275): the console fetches each policy of a document set to Termly (when saved, on request, and once a day while sync is on), cleans its HTML and writes legal_document_texts. It also sets legal_documents.checked_at and check_error. The portal shows the newest row by checked_at for the linked id; it never writes either.

    Column Type Required What it is
    termly_id uuid yes the policy
    locale, locales text [a-z]{2}(-[a-z]{2})?, text[] yes the text’s language, and the languages Termly’s viewer offers
    name, document_version, released_at text 1–300, int, timestamptz name as Termly states them
    html text ≤ 2,000,000 yes cleaned to headings, paragraphs, lists, tables, links (http(s), mailto, #legal-…) and emphasis; no styles, classes, scripts or event attributes
    content_hash text, 64 hex yes SHA-256 of html; one row per policy and text (unique)
    fetched_at, checked_at timestamptz yes first fetched with this text; last found unchanged

    Rows are never deleted (a record of what was published when). Grants: select, insert and update (migration 0333).

  • The operator’s data (ADR 0269): the console edits who runs this Academy; the portal reads it at runtime (cached for at most 30 seconds, no restart). Grants: select, insert and update on platform_operator; select, insert, update and delete on platform_legal_texts (migration 0327).

    platform_operator: one row, id = true (insert it on the first save, then update it). Set updated_at = now() and updated_by (the editor’s account id, or null) on every save; the logo’s address carries updated_at, so browsers fetch a new logo at once.

    Column Type Required What it is
    operation_mode text: saas or single yes (default saas) saas: organisations sign up and contract with the operator. single: the operator and its one organisation are the same company: no contracts, no sign-up of organisations or free learners, no marketplace, no Premium or Pro. The console creates the one organisation with the platform job organisation_create (platform-jobs.md)
    product_name text, 1–80 yes (default Academy) the name in the header, the page titles, mails and the agreements (“for the use of …”)
    description text ≤ 300 the public pages’ description for search engines and link previews
    company_name text ≤ 200 for the contracts the operator’s legal name: provider and processor, footer, withdrawal information
    address text ≤ 500 for the contracts the postal address, one line per line break, the country last
    registration_number, vat_number text ≤ 80 shown with the party
    representative text ≤ 200 “Name, role”: who signs for the operator
    email, phone text contact for withdrawal and cancellation; email is also the data requests’ inbox unless contact_email is set
    privacy_contact text ≤ 300 for the DPA “Name, email”: the contact for data protection
    dpo text ≤ 300 the data protection officer, if there is one (“Name, email”)
    governing_law, courts text for the contracts e.g. Estonian law and the courts of Tallinn (Harju County Court); the text puts them in sentences
    website_url (https://…), website_label text the operator’s website, with the text shown for it
    bot_info_url text, https://… the page that explains the Academy’s web readers, named in their User-Agent (default <web app>/bot)
    source_code_url text, https://… where the running version’s source is (AGPLv3); {commit} is replaced; the portal no longer reads SOURCE_CODE_URL
    logo bytea ≤ 1 MB the logo for light surfaces, served at /v1/public/operator/logo; without one the header shows product_name
    logo_type image/png, image/jpeg, image/webp or image/svg+xml with logo
    logo_width, logo_height int 1–4000 with logo its size in pixels (the header keeps the ratio)
    logo_alt text ≤ 200 the logo’s text for screen readers (default: product_name)
    dpa_sub_processors jsonb array of {"name", "service", "location", "when"} for the DPA, unless platform_providers has sub-processors Annex 3, part A, while the provider register has no active row with dpa_sub_processor; migration 0404 copied it there. Kept, but no longer edited
    dpa_other_recipients jsonb array of {"name", "reason"} Annex 3, part B; null keeps the portal’s list (payment services, proxies, sign-in providers, content delivery)
    dpa_measures jsonb object {"1"…"18": text} 3, 4, 8, 11, 12 for the DPA Annex 2, by the BfDI model’s numbers: 3 backups and recovery, 4 regular review, 8 physical security, 11 IT governance, 12 certification are the operator’s own; any other number replaces the portal’s text
    dpa_revision text [0-9a-z-]{1,20} appended to the DPA’s version (2026-11-1.<revision>); raise it when the facts change, so organisations accept the new version
    dpa_revision_changes jsonb object what each revision changes, in English: {"<dpa_revision>": "…"}; the notice to organisations quotes the entry for the current revision (ADR 0377)

    While a required field is missing, the contracts show it as “[to be confirmed by the operator]”, list it in openPoints, and can’t be accepted. The console can show the same list: GET /v1/public/contracts/dpa and …/terms render the current text.

    platform_legal_texts: the operator’s own legal texts (ADR 0280), one row per key and language, shown where legal_documents.source is own.

    Column Type Required What it is
    key text: one of the eight documents yes the document
    language text, two letters (de, en, …) yes shown to readers in that language; others get default_language, else any
    title text ≤ 200 the page’s heading in this language (default: the document’s usual name)
    markdown text ≤ 500,000 yes the text as written
    html text ≤ 2,000,000 yes the console’s HTML of it: headings from h2, paragraphs, lists, tables, links (http(s), mailto), emphasis, quotes; nothing else
    translated_from text, two letters set when DeepL translated the text from that language; the pages say so
    stand, blocks the old format (ADR 0269), null for texts written since migration 0337

    {company}, {address}, {email}, {phone}, {cancelUrl} and {product} stay in title and html and are filled in from platform_operator where the text is shown, escaped. Then {providers} in html (first a paragraph <p>{providers}</p> of its own, then anywhere) becomes the provider register’s table in the text’s language, the same in the portal and on the website; with no row in the privacy policy, nothing. Without a legal_documents row for withdrawal, the portal shows its German template filled in (with GET /v1/legal/withdrawal/text, template: true).

  • The mascot (ADR 0365): platform_mascot (one row, id = true: name, spoken_name, the live manifest and version, a set being uploaded in pending_manifest and pending_version) and platform_mascot_files (version, name, content_type, bytes, sha256, byte_size). The console writes them; the portal reads the live set (cached for at most 30 seconds) and serves it to signed-in people at /v1/mascot. Only files of the live version are served. To make a pending set live, in one transaction: copy pending_manifest/pending_version to manifest/version, clear them, delete the files of every other version. Grants: select, insert, update and delete (migration 0411, besides the default privileges). tenants.mascot (operator or neutral) is the organisation’s choice, set by its administrators in the portal.

  • The learning app’s models (ADR 0378): companion_models, one row per local model the app may run. The console adds, edits, lists or hides (listed) and deletes rows; the portal fetches each file from source_url, checks size_bytes and sha256, and writes the file’s state (state: pending, fetching, ready, failed; fetched_bytes, fetch_started_at, fetched_at, error). To fetch a failed file again, set state = 'pending' and error = null. Changing file_name, size_bytes, sha256 or source_url makes it pending by itself, and the old file leaves the portal’s store; so does the file of a deleted row. Only listed rows in ready reach the app’s catalog. Set updated_at = now() and updated_by on every save. companion_catalog_keys: the console reads kid, public_jwk, created_at and retired_at (the public key to show), never the private key. companion_catalog_state (version) and companion_model_cleanup are read only. Grants: migration 0419.

    Column Type Required What it is
    id text [a-z0-9][a-z0-9._-]{0,79} yes the model’s id in the app, e.g. ministral-3-3b-instruct-2512-q4_k_m
    display_name text 1–120 yes the name shown
    family text [a-z0-9][a-z0-9._-]{0,59} yes e.g. ministral-3: the app’s prompt templates go by it
    format gguf or litertlm yes how the app runs it: llama.cpp, or Google’s LiteRT-LM (ADR 0405); must match the file’s ending
    provider text 1–120 yes who made the model, e.g. Mistral AI
    license_spdx, license_url SPDX id, https yes the model’s licence
    model_card_url https the maker’s model card (AI Act Art. 53 documentation)
    min_ram_mb int 512–65536 yes the device’s least memory
    file_name text, ends in .gguf or .litertlm yes the file’s name, as the maker names it
    size_bytes, sha256 bigint, lower-case hex yes as the maker publishes them (on Hugging Face: the file’s LFS details)
    source_url https yes where the portal fetches the file
    listed boolean yes (default false) in the app’s catalog once the file is there
  • The learning app’s policy profiles (ADR 0384): companion_policy_profiles, one row per audience (adult, org-adult, org-minor, school), with profile_id, version (raise it with every change), document (jsonb, the app’s profile contract: aiAct, features, …), legal_basis_ref (the review it rests on), valid_from, and published_at (null: a draft the app never sees). Only after the operator’s legal review. The console writes them; the portal signs the published one for the app. Grants: migration 0421.

  • Beta codes (ADR 0401): beta_codes, one row per code. While platform_settings key betaMode is true, students and organisations sign up whatever signupStudents and signupOrganisations say, and only with an unused code; the signup spends it (once). Grants: select and update for the portal, select, insert, update and delete for the console (migration 0431).

    Column Type Required What it is
    code text, twelve of 23456789ABCDEFGHJKMNPQRSTVWXYZ yes, unique stored without prefix and dashes; shown as BETA-XXXX-XXXX-XXXX. The portal reads BETA-…, spaces, dashes and lower case as the same code
    note text ≤ 200 the team’s own note; internal
    used_at, used_for timestamptz, student/organisation both or neither set by the signup that spent it
    account_id, tenant_id uuid the account (and for an organisation, the organisation) it opened; null when that is deleted
    plan, plan_until a pricing_plans key (default enterprise), date plan the plan the organisation a code opens gets, as a beta plan (ADR 0408); a student’s code gives none

    The organisation’s beta plan is a row of organisation_plans with beta = true (migration 0437, insert granted to the portal). Unlike a plan set by hand it yields to a live subscription of the organisation’s own, and once its until is set the organisation may buy one (any plan, a smaller one too); without one it is on Free after until.

  • The provider register (ADR 0359): platform_providers, one row per service provider that receives personal data. The console adds, edits, deactivates and deletes rows (the Providers page); the portal reads the active rows with the operator’s data (cached for at most 30 seconds) for {providers} in own texts and for Annex 3 part A; the website reads the public columns for {providers}. Grants: select, insert, update and delete (migration 0404, besides the default privileges). Set updated_at = now() and updated_by on every save.

    Column Type Required What it is
    position int yes (default 0) the order inside an area
    name text 1–120 yes the brand shown, e.g. OpenAI
    legal_name, address text 1–200, text ≤ 300 (one line) legal_name the company organisations contract with
    country text [A-Z]{2} where the data is processed: an ISO 3166 code or EU
    area hosting, email, lab, ai_language, speech, avatar, ai_pictures, stock_pictures, translation, videos, payments, website_assistant, statistics, sign_in, other yes the group in the privacy policy, in this order
    purpose jsonb object {"<two-letter language>": text ≤ 500} yes (default {}) what the provider does with the data; plain text
    transfer eea, adequacy, dpf, scc, dpf_scc yes (default eea) the safeguard for transfers outside the EU/EEA
    retention_days int ≥ 0 null: as its terms allow; 0: not stored
    no_training boolean yes (default false) true: not used to train its models
    privacy_url text https://… ≤ 500 the provider’s privacy page; its name links there
    in_privacy, active boolean yes (default true) listed in the privacy policy; only active rows are shown anywhere
    dpa_sub_processor boolean yes (default false) listed in Annex 3 part A; needs dpa_service and dpa_location
    dpa_service, dpa_location, dpa_when text ≤ 300 with dpa_sub_processor (not dpa_when) the agreement’s wording, in English; the portal’s only
    dpa_since, note, updated_by date, text ≤ 1000, account id internal: never read by the portal or the website

    Annex 3 part A lists the active rows with dpa_sub_processor by position, then name, as “legal_name, address”; without any, platform_operator.dpa_sub_processors. A change to such a row changes the agreement: raise dpa_revision, write what it changes in dpa_revision_changes, and the platform job tells organisations at least 30 days ahead (§ 8, ADR 0377).

  • No platform team in the portal: platform_admins is gone (ADR 0450). The console’s team is its own (admin.staff); the portal reads only platform.support_team and platform.ticket_assignments, both the console’s.

  • The ticket system is the console’s (ADR 0457, the console’s ADR 0004): its tables (support_tickets, support_ticket_messages, support_ticket_events, support_ticket_files, support_ticket_mail_tokens, support_canned_replies, ticket_mail_outbox) are in the schema platform, moved there by the console’s --db-setup. The portal neither reads nor writes them: it calls only the console’s functions platform.ticket_* / platform.tickets_* (security definer, executable by academy_platform_writer), which keep who sees and does what, and send the ticket mails through the outbox. File contents stay in the portal’s store; the console opens one through a signed link of five minutes that the portal serves (GET /v1/ticket-files/:fileId).

  • Writes the portal reads back exactly:

    • entries in an organisation’s audit_log (the same hash chain);
    • secrets sealed with the console’s key CONSOLE_KMS_KEY (ADR 0442: the payment providers, DeepL, Slack, the proxies, the sign-in apps, the RTC targets, the platform’s messages), which the portal opens; the mail’s secrets with MAIL_SETTINGS_KEY.

The live relay nodes (academy_relay, apps/relay in this repository)

Section titled “The live relay nodes (academy_relay, apps/relay in this repository)”

Every relay node (ADR 0334, relay-nodes.md) connects as academy_relay: no superuser, no BYPASSRLS, no rights on anything else. deploy/update.sh makes the role on the main server and sets its rights on every deploy; migration 0381 grants them where the role exists.

Table Rights
relay_nodes select, insert; update of region, public_url, capacity, public_key, version, active_sessions, last_seen_at (never enabled)
relay_sessions select; update of ticket_hash, credential, connected_at, ended_at, seconds, frames_in, frames_out, end_reason

A node registers itself by name (upsert), beats every 15 seconds, takes a session once (ticket_hash and credential cleared in the same statement) and records its end. Keep these columns and their meaning. The admin console may list the nodes and switch enabled (a follow-up).

The marketing site (academy_site_reader, a separate repository, only where the project’s own website runs)

Section titled “The marketing site (academy_site_reader, a separate repository, only where the project’s own website runs)”

Since ADR 0449 it reads the operator’s tables it shows (legal texts, operator, providers, prices, Pro, mail relay, maintenance windows) in the console’s schema platform, by name platform.<table>; the portal’s own (tenants, organisation_profiles, organisation_restrictions, organisation_addons) stay in public. ADR 0459 moved 28 more operator tables into platform (payment providers, DeepL, Slack, mascot, proxies, retention, signer samples, the learning app’s catalogue, commons and search lists, course_features); the site reads none of them.

It keeps its own tables in its schema site (contact messages, beta applications) and reads these columns of the core schema, each by a column grant:

Table Columns
legal_documents key, termly_id, source, default_language
legal_document_texts id, termly_id, locale, locales, name, document_version, released_at, html, fetched_at, checked_at
platform_legal_texts key, language, title, html, translated_from, updated_at
platform_operator company_name, address, email, phone, product_name (for the placeholders of own texts), dsa_contact_email (the contact point page, ADR 0331), website_url, website_label, vat_number, registration_number, representative, description (the operator’s data on every page, the assistant and the team inbox, since the site’s #500)
platform_providers (ADR 0359) position, name, legal_name, address, country, area, purpose, transfer, retention_days, no_training, privacy_url, in_privacy, active ({providers} in own texts); never dpa_service, dpa_location, dpa_when, dpa_since, note, updated_by
pricing_plans key, position, currency, monthly_cents, yearly_cents, learners, extra_learners_cents, published, features (whether a plan includes its own mascot, ADR 0370), quotas (the site reads only factoryRuns, ADR 0413)
organisation_addons (ADR 0412) key, kind, position, monthly_cents, yearly_cents, once_cents, currency, plans, effect, max_quantity, published; never cost_cents, updated_by
premium_settings ai_daily_requests, month_cents, year_cents, trial_days, voice_minutes_free, voice_minutes_pro, course_prices, course_points_month, course_discount_percent
mail_settings route, smtp_host, smtp_port, smtp_tls, smtp_user, smtp_password (sealed, MAIL_SETTINGS_KEY), m365_*, from_address, from_name, updated_at; and platform.mail_report_site(…) for its own line of mail_senders
maintenance_windows (ADR 0284) id, starts_at, planned_end_at, public_note, announced_at, locked_at, testing_since, ended_at, cancelled_at (the banner, and sign-in greyed while locked)
tenants (ADR 0350) id, slug, name (the organisation profiles)
organisation_profiles (ADR 0350) tenant_id, published, tagline, about, website, email, phone, links, legal
organisation_restrictions (ADR 0350) tenant_id, kind, lifted_at, effective_at (a profile with an active catalogue_hidden restriction is not shown)

Organisation profiles (ADR 0350): the site shows /organisations/<slug> and /organisations/<slug>/legal/<doc> for an organisation whose profile is published and that has no catalogue_hidden restriction with lifted_at null and effective_at in the past (the portal’s publishedBySlug rule). links is [{ "label", "url" }]. legal is a jsonb object, per document key (imprint, privacy, terms, sales, withdrawal) one of:

  • { "termlyId": "<uuid>" } — a Termly policy;
  • { "url": "https://…" } — the organisation’s own page;
  • { "text": { "markdown": "…", "html": "…", "updatedAt": "<ISO>" } } — its own text written in the portal. html is rendered and sanitised by the portal’s API on saving (the console’s renderLegalMarkdown rules: h2–h4, p, lists, tables, links only http(s)/mailto, external ones with target="_blank" rel="noopener noreferrer", no ids, images or raw HTML); the site shows html as it is and never renders the Markdown itself. markdown is at most 100 000 characters.

Nothing in legal is internal: it is what the organisation publishes. The organisation’s contract data (organisation_profiles.contract_details, named processing_details before migration 0320), logo_key, seat_country, withdrawal_confirmations and every other column are not granted. A document a row doesn’t hold, or holds in another shape, is not shown. Keep these shapes; a fourth variant needs a change on the site first.

The site’s deploy creates on each of these three tables two select policies for academy_site_reader: site_reader_v1_published (permissive) and site_reader_v1_only_published (restrictive), both with the rule above (tenants: having such a profile; organisation_restrictions: only kind catalogue_hidden). Restoring a portal dump into a database without the academy_site_reader role fails on these policies: create the roles before the restore.

Its deploy also reads these settings from the portal’s settings file /etc/i3-academy-api.env: DATABASE_URL (host, port and database), CONTACT_EMAIL and BETA_ACCESS_REVIEW_EMAIL; MAIL_SETTINGS_KEY its unit reads from the console’s key file (/etc/academy/keys/mail-settings-key.env, ADR 0481). Keep the file’s path and these names.

  • BETA_ACCESS_REVIEW_EMAIL is no setting of the portal’s any more; it stays in the file for the site.
  • The role in DATABASE_URL is the portal’s own (academy_portal, no superuser). The site sets up its role and schema as the database’s superuser.

Self-hosted installations have no marketing site. Its role, schema and grants exist only where the website’s own repository set them up.