- Add 26 documentation files including test reports, deployment guides, and troubleshooting documentation - Include 3 CSV data files for trainer imports and user registration tracking - Add 43 JavaScript test files covering mobile optimization, Safari compatibility, and E2E testing - Include 18 PHP utility files for debugging, geocoding, and data analysis - Add 12 shell scripts for deployment verification, user management, and database operations - Update .gitignore with whitelist patterns for development files, documentation, and CSV data 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
3.7 KiB
3.7 KiB
HVAC Trainer Role Migration Guide
Date: July 23, 2025
Issue: Master dashboard not showing all HVAC trainers
Resolution: Legacy role migration from event_trainer to hvac_trainer
Problem Description
The master dashboard was only showing 4 out of 15 HVAC trainer users. Investigation revealed that 11 users had the legacy event_trainer role instead of the current hvac_trainer role.
Root Cause
- Master dashboard code only queries for users with
hvac_trainerandhvac_master_trainerroles - 11 users had legacy
event_trainerrole from previous development - These users were invisible to the master dashboard analytics
Solution Summary
Migration Process: Convert all event_trainer users to hvac_trainer role
Users Migrated:
- andys@genzryan.com
- ben@tealmaker.com
- david@hvacinstituteinc.com
- dpetz@johnstonenjpa.com
- eric.energy@gmail.com
- Greg.a.kula@gmail.com
- hhr.handc@gmail.com
- janderson@sila.com
- mnantel@republicsupplyco.com
- rigobertohugo19 (info103@noreply0.com)
- thoffmaster@hoffmastermechanical.com
Migration Script
The migration was performed using migrate-event-trainers.sh:
#!/bin/bash
# Migration script: migrate-event-trainers.sh
# For each event_trainer user:
wp user remove-role "$username" event_trainer
wp user add-role "$username" hvac_trainer
Verification Commands
# Check role counts before migration
wp user list --role=event_trainer --format=count
wp user list --role=hvac_trainer --format=count
# Perform migration
./migrate-event-trainers.sh
# Verify migration completed
wp user list --role=event_trainer --format=count # Should be 0
wp user list --role=hvac_trainer --format=count # Should be 14
Results
Before Migration
- HVAC Trainers: 3 users
- Event Trainers: 11 users (invisible to master dashboard)
- Master Dashboard: Showed 4 total trainers
After Migration
- HVAC Trainers: 14 users ✅
- HVAC Master Trainers: 3 users ✅
- Event Trainers: 0 users ✅
- Master Dashboard: Shows 15 total trainers ✅
Master Dashboard Statistics
- Total Trainers: 15 (increased from 4)
- Total Events: 16 events across all trainers
- Complete Analytics: All trainer data now visible
- Legacy Cleanup: All
event_trainerrole artifacts removed
Prevention
To prevent similar issues in the future:
- Consistent Role Naming: Always use
hvac_trainerfor trainer users - Role Verification: Check user roles during testing
- Master Dashboard Testing: Verify all trainers appear in analytics
- Migration Scripts: Keep role migration scripts for future use
Testing Verification
Master Dashboard Query Test:
$trainer_users = get_users(array(
'role__in' => array('hvac_trainer', 'hvac_master_trainer'),
'fields' => 'ID'
));
// Should return 15 users after migration
Master Dashboard Access:
- Login as master trainer: joe@measurequick.com
- Navigate to:
/master-trainer/dashboard/ - Verify: 15 trainers visible in analytics
- Confirm: All trainer statistics display correctly
Files Modified
- Migration Script:
migrate-event-trainers.sh(created) - Verification Script:
verify-master-dashboard-data.sh(created) - Documentation:
CLAUDE.md(updated with fix details) - Documentation:
README.md(updated user counts)
Deployment Notes
- Code Changes: No code changes required (only data migration)
- Database Changes: User role metadata updated
- Cache Clearing: Automatic via deployment script
- Verification: Master dashboard functionality confirmed
The migration resolved the issue completely and all HVAC trainers are now properly visible in the master dashboard analytics.