tascan_merge_workers
Merge duplicate worker records into one canonical identity (Patent 4 identity consolidation). Reassigns every reference (completions, timer events, points, payments, rosters — 31 columns across 31 tables), backfills missing phone/email on the primary, sums points, and tombstones the duplicates (merged_into + is_active=false — NEVER hard-deletes). ALWAYS run with dry_run=true first and show Mike the counts; pass dry_run=false only after explicit confirmation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | true (default) = report reassignment counts only, change nothing. false = execute atomically. | |
| primary_worker_id | Yes | The canonical worker that survives (usually the one with a phone) | |
| duplicate_worker_ids | Yes | Worker IDs to fold into the primary (max 20) |