halkyon/apps/learn/halkyon_learn_server/migrations/migration_registry.txt
Tizian 「ティツィアーン」 d08d8ad545
feat(base,learn): spaces people share, kept by halkyon_base
ADR 0044, step 2 (D1, D2, D11, D13, and D15 to D17, decided today).
halkyon_base keeps the spaces several people share, for every app:
shared_space, its members with their roles (Owner, Editor, Viewer), and
invitations by handle waiting for someone with no account on the
service yet. The sharedSpace endpoint creates a space, lists its
members, invites by handle, changes roles, removes members, hands the
space on, leaves and deletes it.

Who may do what:
- Only people with an identity reach the endpoint.
- A space the caller isn't in can't be told from one that doesn't
  exist.
- Members are named by their membership, never by their account's ID.
- Only the Owner manages the members, unless the space lets members
  invite.
- The Owner's role passes only by handing the space on, and the Owner
  leaves only naming who takes it on.
- An invitation counts as an answer about a handle, as it tells whether
  one exists.
Every rule has a test asserting the refusal.

The module stays free of the sync engine: a host hands it a SpaceGrants,
and every call runs in the module's transaction, so the engine's grants
follow the roles or nothing changes. The Owner and an Editor write; a
Viewer reads. Learn hands over SyncSpaceGrants on OfflineSyncSpaces. Todo
hands over none yet, so its server refuses until its projects are
shared.

Deleting an account hands each space the person owns to the Editor who
joined first, else the Viewer who joined first. A space with no other
member goes. This runs before the host's own deletions. A person's first
sign-in on a service makes their waiting invitations memberships, in the
same transaction that makes them a person there.

Migrations: the module's and every host's (Learn, Todo, Train, Meditate)
create the three tables, their indexes and the two cascading foreign
keys to shared_space, and nothing else. The old server keeps working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-11 10:54:19 +01:00

56 lines
1.9 KiB
Text

### AUTOMATICALLY GENERATED DO NOT MODIFY
###
### This file is generated by Serverpod when creating a migration, do not modify it
### manually. If a collision is detected in this file when doing a code merge, resolve
### the conflict by removing and recreating the conflicting migration.
20260916165410927
20260930094729362-studysets
20260930122235111-cards
20260930145136285-reviews
20261001064926911-tree-tags-assets
20261002035419149-file-allowance
20261002191122122-notes
20261002211346701-learning-paths
20261003110855698-pdf-sources
20261007205440868-card-buried-at
20261008165051407-pdf-position
20261008223835206-dictionaries
20261009123850448-dictionary-kind
20261009145434785-dictionary-entry-version
20261009184924904-public-profiles
20261009195137836-published-studysets
20261009202105673-explore
20261009215552429-learner-count
20261009220324372-based-on
20261009224606274-feedback
20261010095547719-assistant-connector
20261012162411835-studyset-deleted-at
20261013035552510-dictionary-keys
20261014153932647-release-colour
20261015171326465-email-sign-in
20261015220121195-verified-links
20261015220626303-discussions
20261017110130653
20261019121406578-halkyon-base
20261019201023295-profiles-in-halkyon-base
20261019204112282-deletion-notices
20261020111943300-passwords
20261020125117584-sessions-ended
20261020185750538-recovery-proof-key
20261020194228286-second-factor-waits
20261020204619104-session-code-tries
20261020211224692-email-code-purpose
20261021100422048-session-ended-warning
20261021110159867-second-factor-paths
20261021134803749-reset-hold-outs
20261021184601197-private-studysets
20261023131636437
20261023181810112-oidc-module
20261023192913178-simplelogin-keys
20261025135744595-waiting-accounts
20261025165102861-assistants
20261025184004860-assistant-conversations
20261026140329810-assistant-budgets
20261110225358224-file-store-in-halkyon-base
20261111091720823-shared-spaces