Migrate desks from `desks` metadata on `level` zones into the `asset` table. The migration runs in a single transaction and is safe to re-run. - [x] Collect: authorities that have `config.org_zone` → zone tree → level branches → `desks` metadata - [x] Prepare: lenient field mapping (`map_id`/`identifier` fall back to `id`; `security` becomes an array) - [x] Transaction: create or reuse the `_DESKS_` category and type per authority; upsert assets on (type, zone_id, map_id) - [x] Remap desk bookings: `asset_id` + `asset_ids` → Asset#id (also booking_instances overrides); report misses - [x] Merge `{"desk": {"use_assets": true}}` into each org zone's `settings` metadata - [x] Print a summary; add an opt-in `dry_run=true` (rolls back) - [x] `migrate:desk_assets` sam task + README - [x] Spec suite for init (`./test`, docker compose, CI job) covering mapping, misses, re-runs and dry run
Activity
stakach commentedon Oct 30, 2026
Implemented in #107 (specs green, smoke tested on migrated Postgres).