Store.Project.Entry.MigrateAbsToRelPathKeys (fnord v0.8.83)

View Source

Handles migration of project store entries from absolute-path-based IDs to relative-path-based IDs.

This module provides functionality to:

  • Detect when migration is needed for entry ID scheme changes
  • Coordinate cross-process migration with lockfiles
  • Migrate entry directories and metadata files from absolute-path keys to relative-path keys
  • Ensure entries use relative paths for portability across machines

Summary

Functions

Ensures that all entries in the project use relative-path based IDs.

Functions

ensure_relative_entry_ids(project)

@spec ensure_relative_entry_ids(Store.Project.t()) :: :ok

Ensures that all entries in the project use relative-path based IDs.

This function is idempotent and safe to call multiple times. It uses a lockfile to prevent concurrent migrations and will raise if another process is already performing the migration.