‹ Home

⚙️ Migrations

One-time data migrations to move into the new schema. Safe to re-run.

1. Ensure user profiles

Make sure /users/{uid} docs have the new required fields (currentGymId, weightUnit, role).

Click "Dry run" to preview.

6. Normalize IDs — slug-key muscleGroups, add groupId to entries

Renames /muscleGroups docs from numeric (222) to slug (chest, back-hz, etc.). Cascades to /exercises.groupId and adds groupId field on every entry by looking up its exerciseId. Idempotent.

Click "Dry run" to preview.

5. Fold legacy time/source/legacyDate into sessionNotes

Prepends [logged at HH:MM:SS] to sessionNotes, then removes the extra legacy fields. Idempotent.

Click "Dry run" to preview.

4. Re-key legacy sessions (userId: "prosk"/"connor" → Auth UID)

For sessions where userId is still a role string, set it to the Firebase Auth UID and add userRole / userEmail / legacy: true. Doc IDs unchanged. dayNum/week stay null (AppSheet didn't track them).

Click "Dry run" to preview.

3. Backfill exerciseId on entries (match by name)

Looks at every entry across all sessions. If exerciseId is null, it tries to find a match in /exercises by name (normalized; word-order tolerant). Idempotent.

Click "Dry run" to preview.

2. Migrate gymLogssessions + entries

Reads from drprosk-personal/gymLogs and writes to gym-tracker-d11c3/sessions/{sid}/entries/*. Idempotent — re-running overwrites.

Old gymLogs: ? Migrated sessions: ?
Click "Refresh counts" to see current state.