halkyon/apps/learn/halkyon_learn_client/lib/migrations/migration_registry.dart
Tizian 「ティツィアーン」 7f1f07883a
feat(base,app,learn): a shared space's key rolls once a member goes
What is written in a shared space after a member went takes a key they
never get (Halkyon's ADR 0044, D22). The instance marks the space as one
of its members goes, removed, leaving or deleted (`keyRollDue` on
`shared_space`, set in `removeMember`, through which each of them
passes); an invitation taken back never had a key and marks nothing, nor
does a new role. The Owner's or an Editor's device that next keeps its
keys up after a sync is told so (`sharedSpaceKeys.rollDue`, never true
for a Viewer, who seals no key) and makes a new key, sealed to those who
stay (D33). The first seal bringing a key ID the space never had clears
the mark in the same transaction (D34); members the rolling device
missed get it later as newcomers do. Earlier rows keep the key they had,
which whoever went had read already.

The migration, the same in the module and in each server including it
(Learn, Meditate, Todo, Train):

  ALTER TABLE "shared_space"
    ADD COLUMN "keyRollDue" boolean NOT NULL DEFAULT false;

It adds the column with false for every space there is, so no space is
due a roll from it; PostgreSQL adds a column with a constant default
without rewriting the table. The server before the switch reads and
writes the table naming its own columns, so it keeps working.

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

89 lines
4.4 KiB
Dart

/// AUTOGENERATED BY SERVERPOD create-migration - DO NOT EDIT BY HAND
/// Merging: resolve registry conflicts the same as migration_registry.txt.
library;
import 'package:serverpod_database/serverpod_database.dart';
part '20260930094729362-studysets/migration.dart';
part '20260930122235111-cards/migration.dart';
part '20260930145136285-reviews/migration.dart';
part '20261001064926911-tree-tags-assets/migration.dart';
part '20261002191122122-notes/migration.dart';
part '20261002211346701-learning-paths/migration.dart';
part '20261003110855698-pdf-sources/migration.dart';
part '20261007205440868-card-buried-at/migration.dart';
part '20261008165051407-pdf-position/migration.dart';
part '20261009224606274-feedback/migration.dart';
part '20261012162411835-studyset-deleted-at/migration.dart';
part '20261019121406578-halkyon-base/migration.dart';
part '20261019201023295-profiles-in-halkyon-base/migration.dart';
part '20261019204112282-deletion-notices/migration.dart';
part '20261020111943300-passwords/migration.dart';
part '20261020125117584-sessions-ended/migration.dart';
part '20261020185750538-recovery-proof-key/migration.dart';
part '20261020194228286-second-factor-waits/migration.dart';
part '20261020204619104-session-code-tries/migration.dart';
part '20261020211224692-email-code-purpose/migration.dart';
part '20261021100422048-session-ended-warning/migration.dart';
part '20261021110159867-second-factor-paths/migration.dart';
part '20261021134803749-reset-hold-outs/migration.dart';
part '20261021184601197-private-studysets/migration.dart';
part '20261023181810112-oidc-module/migration.dart';
part '20261023192913178-simplelogin-keys/migration.dart';
part '20261025135744595-waiting-accounts/migration.dart';
part '20261025165102861-assistants/migration.dart';
part '20261025184004860-assistant-conversations/migration.dart';
part '20261026140329810-assistant-budgets/migration.dart';
part '20261110225336783-file-store-in-halkyon-base/migration.dart';
part '20261110225358224-file-store-in-halkyon-base/migration.dart';
part '20261111091720823-shared-spaces/migration.dart';
part '20261111100124819-shared-space-keys/migration.dart';
part '20261111110923694-own-rows-by-id/migration.dart';
part '20261111145608988-shared-space-key-roll/migration.dart';
/// Migration registry for the client-side database.
class MigrationRegistry {
/// Ordered list of all client-side database migrations.
/// New migrations are always appended at the end.
static final List<MigrationVersionSql> migrations = [
_Migration20260930094729362_studysets(),
_Migration20260930122235111_cards(),
_Migration20260930145136285_reviews(),
_Migration20261001064926911_tree_tags_assets(),
_Migration20261002191122122_notes(),
_Migration20261002211346701_learning_paths(),
_Migration20261003110855698_pdf_sources(),
_Migration20261007205440868_card_buried_at(),
_Migration20261008165051407_pdf_position(),
_Migration20261009224606274_feedback(),
_Migration20261012162411835_studyset_deleted_at(),
_Migration20261019121406578_halkyon_base(),
_Migration20261019201023295_profiles_in_halkyon_base(),
_Migration20261019204112282_deletion_notices(),
_Migration20261020111943300_passwords(),
_Migration20261020125117584_sessions_ended(),
_Migration20261020185750538_recovery_proof_key(),
_Migration20261020194228286_second_factor_waits(),
_Migration20261020204619104_session_code_tries(),
_Migration20261020211224692_email_code_purpose(),
_Migration20261021100422048_session_ended_warning(),
_Migration20261021110159867_second_factor_paths(),
_Migration20261021134803749_reset_hold_outs(),
_Migration20261021184601197_private_studysets(),
_Migration20261023181810112_oidc_module(),
_Migration20261023192913178_simplelogin_keys(),
_Migration20261025135744595_waiting_accounts(),
_Migration20261025165102861_assistants(),
_Migration20261025184004860_assistant_conversations(),
_Migration20261026140329810_assistant_budgets(),
_Migration20261110225336783_file_store_in_halkyon_base(),
_Migration20261110225358224_file_store_in_halkyon_base(),
_Migration20261111091720823_shared_spaces(),
_Migration20261111100124819_shared_space_keys(),
_Migration20261111110923694_own_rows_by_id(),
_Migration20261111145608988_shared_space_key_roll(),
];
/// List of all client-side database migration versions.
static List<String> get versions => migrations.map((m) => m.version).toList();
}