Skip to content

Migrate desk metadata to assets #106

Closed

Description

@stakach

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.

  • Collect: authorities that have config.org_zone → zone tree → level branches → desks metadata
  • Prepare: lenient field mapping (map_id/identifier fall back to id; security becomes an array)
  • Transaction: create or reuse the _DESKS_ category and type per authority; upsert assets on (type, zone_id, map_id)
  • Remap desk bookings: asset_id + asset_ids → Asset#id (also booking_instances overrides); report misses
  • Merge {"desk": {"use_assets": true}} into each org zone's settings metadata
  • Print a summary; add an opt-in dry_run=true (rolls back)
  • migrate:desk_assets sam task + README
  • Spec suite for init (./test, docker compose, CI job) covering mapping, misses, re-runs and dry run

Activity

  1. stakach commented on Oct 30, 2026

    @stakach
    MemberAuthor

    Implemented in #107 (specs green, smoke tested on migrated Postgres).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions