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.
- Add the new column or table first.
- Let the other side switch to it, in its own repository and deploy.
- 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_adminowns the schemasadminandplatform; after the console’sdeploy/database-role-split.sqlit has no right inpublicat all, and noBYPASSRLS.academy_admin_corereads and writes the portal’s tables the console’s code names, and has no right onadmin. NoBYPASSRLS(ADR 0442): on a table with row-level security it sees rows only through its own policiesconsole_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.tsscans its code and writes the list into itsdeploy/database-role.sql(the portal’s tables) andapps/api/sql/platform-grants.sql(its ownplatform, with the portal’sacademy_platform_readerand the write-backs ofacademy_platform_writer);test/core-grants.test.tsandtest/database-rights.test.tsthere fail when code and lists part. Everyinstall.sh --db-setuptakes all of the core role’s rights onpublicaway 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 setstenants.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 ofpublicas 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 viewsops_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 throughacademy_platform_readerand writes back only the columns ofacademy_platform_writer; a change to them is the console’s migration, never the portal’s, and no table ofpublicmay 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_jobsand 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(dayfor a scheduled run,started_at,finished_at,countsandforecastas JSON objects keyed by kind,failed),account_inactivity_notices(counted only) andaccounting_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(monthas the first day in UTC,recipients,outside_eu,unknown,excluded,computed_at), which the portal writes every hour; it never readsdsa_active_recipients(account ids, kept two months). It editsplatform_operator.dsa_contact_email(optional; the website falls back toemail). -
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_commissionordispute_costs_byofplatform_marketplace, nor an exception’ssale_model,commission_bps,commission_fixed_centsinorganisation_payments, directly: it inserts a row intomarketplace_term_changes.Column Type What it is tenant_iduuid or null null: the platform’s defaults; else the organisation’s exception terms,previousjsonb 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_bytext ≤ 500, the team member’s email cancelled_at,cancelled_bythe console withdraws a change before it is applied One open change per scope (unique index
marketplace_term_changes_open). The database refuseseffective_atearlier than 15 days afternotified_at. -
Erasures (ADR 0330): the console’s Stuck deletions page reads
erasure_file_cleanup(object_keyonly for its first part, the kind;attempts,queued_atas the first try,last_tried_at,retry_at,ticket_id) anderasure_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” setsretry_atornext_try_atto now and nothing else; the portal never takes fromerasure_replayswhat to erase. Its Erasures page readsorganisation_erasuresand asks forerase_organisation; it checks thaterasure_replaysexists (migration 0378) before it does. -
Declarations to cancel or withdraw (ADR 0277):
premium_terminationskeeps every declaration sent through the portal’s public form, not only Pro.contractsays which (premium,organisation,academy),referencehow the person named it,forwardedthe organisations it went to as tickets ([{tenantId, ticketId}]). The outcomesforwarded(passed on to the seller) andreceived(the platform’s team handles it,needs_review) are new;handled_atstays the console’s. -
Where each legal document comes from (ADR 0280):
legal_documents, one row per published document.Column Type Required What it is keytext: imprint,terms,sales,privacy,withdrawal,cookies,acceptableUse,disclaimeryes the document sourcetext: termlyorownyes (default termly)Termly’s policy, or the operator’s own texts in platform_legal_textstermly_iduuid with termlythe policy; kept when the source changes to ownsyncboolean yes (default true) Termly: fetched once a day; false keeps the last fetched text until fetched again default_languagetext, two letters yes (default en)own texts: shown to readers whose language has none checked_at,check_errortimestamptz, 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
syncis on), cleans its HTML and writeslegal_document_texts. It also setslegal_documents.checked_atandcheck_error. The portal shows the newest row bychecked_atfor the linked id; it never writes either.Column Type Required What it is termly_iduuid yes the policy locale,localestext [a-z]{2}(-[a-z]{2})?, text[]yes the text’s language, and the languages Termly’s viewer offers name,document_version,released_attext 1–300, int, timestamptz name as Termly states them htmltext ≤ 2,000,000 yes cleaned to headings, paragraphs, lists, tables, links (http(s), mailto, #legal-…) and emphasis; no styles, classes, scripts or event attributescontent_hashtext, 64 hex yes SHA-256 of html; one row per policy and text (unique)fetched_at,checked_attimestamptz 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 onplatform_legal_texts(migration 0327).platform_operator: one row,id = true(insert it on the first save, then update it). Setupdated_at = now()andupdated_by(the editor’s account id, or null) on every save; the logo’s address carriesupdated_at, so browsers fetch a new logo at once.Column Type Required What it is operation_modetext: saasorsingleyes (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 joborganisation_create(platform-jobs.md)product_nametext, 1–80 yes (default Academy)the name in the header, the page titles, mails and the agreements (“for the use of …”) descriptiontext ≤ 300 the public pages’ description for search engines and link previews company_nametext ≤ 200 for the contracts the operator’s legal name: provider and processor, footer, withdrawal information addresstext ≤ 500 for the contracts the postal address, one line per line break, the country last registration_number,vat_numbertext ≤ 80 shown with the party representativetext ≤ 200 “Name, role”: who signs for the operator email,phonetext contact for withdrawal and cancellation; emailis also the data requests’ inbox unlesscontact_emailis setprivacy_contacttext ≤ 300 for the DPA “Name, email”: the contact for data protection dpotext ≤ 300 the data protection officer, if there is one (“Name, email”) governing_law,courtstext for the contracts e.g. Estonian lawandthe courts of Tallinn (Harju County Court); the text puts them in sentenceswebsite_url(https://…),website_labeltext the operator’s website, with the text shown for it bot_info_urltext, https://…the page that explains the Academy’s web readers, named in their User-Agent (default <web app>/bot)source_code_urltext, https://…where the running version’s source is (AGPLv3); {commit}is replaced; the portal no longer readsSOURCE_CODE_URLlogobytea ≤ 1 MB the logo for light surfaces, served at /v1/public/operator/logo; without one the header showsproduct_namelogo_typeimage/png,image/jpeg,image/webporimage/svg+xmlwith logologo_width,logo_heightint 1–4000 with logoits size in pixels (the header keeps the ratio) logo_alttext ≤ 200 the logo’s text for screen readers (default: product_name)dpa_sub_processorsjsonb array of {"name", "service", "location", "when"}for the DPA, unless platform_providershas sub-processorsAnnex 3, part A, while the provider register has no active row with dpa_sub_processor; migration 0404 copied it there. Kept, but no longer editeddpa_other_recipientsjsonb array of {"name", "reason"}Annex 3, part B; null keeps the portal’s list (payment services, proxies, sign-in providers, content delivery) dpa_measuresjsonb object {"1"…"18": text}3,4,8,11,12for the DPAAnnex 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_revisiontext [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 versiondpa_revision_changesjsonb 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/dpaand…/termsrender the current text.platform_legal_texts: the operator’s own legal texts (ADR 0280), one row perkeyandlanguage, shown wherelegal_documents.sourceisown.Column Type Required What it is keytext: one of the eight documents yes the document languagetext, two letters ( de,en, …)yes shown to readers in that language; others get default_language, else anytitletext ≤ 200 the page’s heading in this language (default: the document’s usual name) markdowntext ≤ 500,000 yes the text as written htmltext ≤ 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_fromtext, two letters set when DeepL translated the text from that language; the pages say so stand,blocksthe old format (ADR 0269), null for texts written since migration 0337 {company},{address},{email},{phone},{cancelUrl}and{product}stay intitleandhtmland are filled in fromplatform_operatorwhere the text is shown, escaped. Then{providers}inhtml(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 alegal_documentsrow forwithdrawal, the portal shows its German template filled in (withGET /v1/legal/withdrawal/text,template: true). -
The mascot (ADR 0365):
platform_mascot(one row,id = true:name,spoken_name, the livemanifestandversion, a set being uploaded inpending_manifestandpending_version) andplatform_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 liveversionare served. To make a pending set live, in one transaction: copypending_manifest/pending_versiontomanifest/version, clear them, delete the files of every other version. Grants: select, insert, update and delete (migration 0411, besides the default privileges).tenants.mascot(operatororneutral) 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 fromsource_url, checkssize_bytesandsha256, 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, setstate = 'pending'anderror = null. Changingfile_name,size_bytes,sha256orsource_urlmakes it pending by itself, and the old file leaves the portal’s store; so does the file of a deleted row. Onlylistedrows inreadyreach the app’s catalog. Setupdated_at = now()andupdated_byon every save.companion_catalog_keys: the console readskid,public_jwk,created_atandretired_at(the public key to show), never the private key.companion_catalog_state(version) andcompanion_model_cleanupare read only. Grants: migration 0419.Column Type Required What it is idtext [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_mdisplay_nametext 1–120 yes the name shown familytext [a-z0-9][a-z0-9._-]{0,59}yes e.g. ministral-3: the app’s prompt templates go by itformatgguforlitertlmyes how the app runs it: llama.cpp, or Google’s LiteRT-LM (ADR 0405); must match the file’s ending providertext 1–120 yes who made the model, e.g. Mistral AIlicense_spdx,license_urlSPDX id, https yes the model’s licence model_card_urlhttps the maker’s model card (AI Act Art. 53 documentation) min_ram_mbint 512–65536 yes the device’s least memory file_nametext, ends in .ggufor.litertlmyes the file’s name, as the maker names it size_bytes,sha256bigint, lower-case hex yes as the maker publishes them (on Hugging Face: the file’s LFS details) source_urlhttps yes where the portal fetches the file listedboolean 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 peraudience(adult,org-adult,org-minor,school), withprofile_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, andpublished_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. Whileplatform_settingskeybetaModeistrue, students and organisations sign up whateversignupStudentsandsignupOrganisationssay, 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 codetext, twelve of 23456789ABCDEFGHJKMNPQRSTVWXYZyes, unique stored without prefix and dashes; shown as BETA-XXXX-XXXX-XXXX. The portal readsBETA-…, spaces, dashes and lower case as the same codenotetext ≤ 200 the team’s own note; internal used_at,used_fortimestamptz, student/organisationboth or neither set by the signup that spent it account_id,tenant_iduuid the account (and for an organisation, the organisation) it opened; null when that is deleted plan,plan_untila pricing_planskey (defaultenterprise), dateplanthe 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_planswithbeta = 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 itsuntilis set the organisation may buy one (any plan, a smaller one too); without one it is on Free afteruntil. -
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). Setupdated_at = now()andupdated_byon every save.Column Type Required What it is positionint yes (default 0) the order inside an area nametext 1–120 yes the brand shown, e.g. OpenAIlegal_name,addresstext 1–200, text ≤ 300 (one line) legal_namethe company organisations contract with countrytext [A-Z]{2}where the data is processed: an ISO 3166 code or EUareahosting,email,lab,ai_language,speech,avatar,ai_pictures,stock_pictures,translation,videos,payments,website_assistant,statistics,sign_in,otheryes the group in the privacy policy, in this order purposejsonb object {"<two-letter language>": text ≤ 500}yes (default {})what the provider does with the data; plain text transfereea,adequacy,dpf,scc,dpf_sccyes (default eea)the safeguard for transfers outside the EU/EEA retention_daysint ≥ 0 null: as its terms allow; 0: not stored no_trainingboolean yes (default false) true: not used to train its models privacy_urltext https://…≤ 500the provider’s privacy page; its name links there in_privacy,activeboolean yes (default true) listed in the privacy policy; only active rows are shown anywhere dpa_sub_processorboolean yes (default false) listed in Annex 3 part A; needs dpa_serviceanddpa_locationdpa_service,dpa_location,dpa_whentext ≤ 300 with dpa_sub_processor(notdpa_when)the agreement’s wording, in English; the portal’s only dpa_since,note,updated_bydate, text ≤ 1000, account id internal: never read by the portal or the website Annex 3 part A lists the active rows with
dpa_sub_processorbyposition, thenname, as “legal_name,address”; without any,platform_operator.dpa_sub_processors. A change to such a row changes the agreement: raisedpa_revision, write what it changes indpa_revision_changes, and the platform job tells organisations at least 30 days ahead (§ 8, ADR 0377). -
No platform team in the portal:
platform_adminsis gone (ADR 0450). The console’s team is its own (admin.staff); the portal reads onlyplatform.support_teamandplatform.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 schemaplatform, moved there by the console’s--db-setup. The portal neither reads nor writes them: it calls only the console’s functionsplatform.ticket_*/platform.tickets_*(security definer, executable byacademy_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 withMAIL_SETTINGS_KEY.
- entries in an organisation’s
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.htmlis 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 withtarget="_blank" rel="noopener noreferrer", no ids, images or raw HTML); the site showshtmlas it is and never renders the Markdown itself.markdownis 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_EMAILis no setting of the portal’s any more; it stays in the file for the site.- The role in
DATABASE_URLis 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.