halkyon/apps/train/halkyon_train_server/migrations/migration_registry.txt

16 lines
567 B
Text
Raw Normal View History

### 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.
20261028075229917-initial
20261028101012641-workouts
20261028164640000-profile
20261028181405893-days
20261028211508606-plans
20261028231042668-routes
20261102103211357-training-places
20261102113104496-strength-plans
feat(train): weight, entered on Progress and read from Health Connect, sealed and synced (ADR 0030, D63) A person's weights are each a sealed `body_weight` row, as the days and the places: the weight in grams, when it was measured (UTC), where it came from and, for Health Connect's, the record's id and app are the payload; the server sees the space and the ciphertext alone. Progress gets a Weight card after Your body: the latest and its day, its line over time (held, each weight and its day), the plus to enter one (a comma taken as a point, 20 to 400 kg, when measured, today by default) and All, the list to delete one. The latest weight is also Your body's, which the band's and the zones' figures work from. In kilograms alone: Train is metric throughout and has no units setting yet. Health Connect's weight records are read in when switched on in its screen (READ_WEIGHT, asked as the others): each record once, its id kept in health_connect.json also after it is deleted here, never Train's own, and none within 10 minutes and 0.1 kg of a weight entered in Train. The migration (20261103204323683-body-weights): - creates (or replaces, unchanged) `gen_random_uuid_v7()`, the default of every UUID id, as each of Serverpod's migrations does; - CREATE TABLE "body_weight": "id" uuid primary key defaulting to a UUID v7, "spaceId" bigint (the sync space), "keyId" text (the key that sealed it), "payload" bytea NOT NULL (the sealed content), "nonce" bytea; - CREATE INDEX "body_weight_space_idx" on "spaceId", for a space's rows as the sync reads them; - a foreign key from "spaceId" to "offline_sync_spaces"("id"), ON DELETE CASCADE, so that an account's deletion takes its weights with its space; - the version rows of Train's and every module's migrations. Nothing existing changes, so nothing is lost. Tests: the row written and read back in its owner's space, and the denials: another person reads none of them, and writing one into another's space throws OfflineSyncSpaceMembershipException and leaves it empty; an account's deletion takes them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-03 22:11:57 +01:00
20261103204323683-body-weights
refactor(base,learn): people's files kept by halkyon_base ADR 0043, D2, D4, D6 and D7, the first step towards Todo's attachments: Learn's file store moves into the module, for every server that keeps files, and Learn becomes its first host. halkyon_base gets the store as Learn had it: uploads into the caller's own space by SHA-256, downloads by a row the caller may read, each person's room (FILE_LIMIT_IDENTIFIED_MB, FILE_LIMIT_INSTANCE_MB, the operator's file_allowance, which moves into the module unchanged) and the pruning of files no live row names. It stays free of the sync engine: a host hands it a FileStore saying which of its rows name a file and what it takes (HalkyonBase.files); without one the files endpoint refuses. Its tests, with refusals, run on a stand-in host. Learn hands it learnFiles: its asset rows, read by their space's members, a readable file over 20 MB only as a PDF, up to 100 MB. Its app calls the module; its own asset endpoint stays for released apps alone, forwarding to the module in Learn's own models, whose names are on the wire. Its file tests still pass through it, end to end. Migrations: the module's creates file_allowance. Learn's server migration holds version rows alone, as tables are matched by name (ADR 0014); its device migration creates the module's empty table, as every module's. Todo's, Train's and Meditate's create the empty table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
2026-11-11 00:11:36 +01:00
20261110225636220-file-store