Appearance
Quick Start - Event-Specific Participant Data Migration
TL;DR - Commands to Run
Run these commands in your Docker container in this exact order:
bash
# 1. Data Migration (preserves existing data)
node scripts/migrateParticipantDataToEventSpecific.js
# 2. Schema Migration (creates new tables, removes old columns)
npx prisma migrate dev --name add_event_specific_participant_data
# 3. Generate Prisma Client
npx prisma generate
# 4. Exit and restart your container
exit
# Then restart your Docker containerWhat This Does
Before Migration
Participant Table:
├── email: "john@example.com"
├── industry: "Agriculture" ← Global, same for all events
├── productsOffered: "Fruits" ← Global, same for all events
└── productsSought: "Packaging" ← Global, same for all eventsProblem: John can't attend a packaging event because he'll be matched as an agriculture/fruits person.
After Migration
Participant Table (Identity):
└── email: "john@example.com"
EventParticipantData Table (Business, per event):
├── Event A (Agriculture)
│ ├── industry: "Agriculture"
│ ├── productsOffered: "Fruits"
│ └── productsSought: "Fertilizer"
│
└── Event B (Packaging)
├── industry: "Manufacturing"
├── productsOffered: null
└── productsSought: "Packaging materials"Solution: John can now be matched correctly at the packaging event as a packaging buyer.
Verify Migration Success
Check Data Migrated
bash
# Open Prisma Studio
npx prisma studio
# Check these tables:
# 1. event_participant_data → Should have records for all participants
# 2. participants → Should NOT have columns: industry, products_offered, etc.Test Matching
bash
# Run matching on an existing event through your admin UI
# Verify that matches are still generated correctly
# Products/industry should come from event_participant_data tableWhat Changed in Code
CSV Upload (Already Updated)
- Still works the same from user perspective
- Behind the scenes: creates EventParticipantData records
- File: participantController.js
Matching Algorithm (Already Updated)
- Automatically fetches event-specific data
- File: advancedMatchingService.js
API Endpoints (Already Updated)
GET /api/participant/profile- Returns event-specific dataPUT /api/participant/profile- Updates event-specific data- File: participantAuthController.js
Rollback (If Needed)
bash
# 1. Restore old schema
git checkout HEAD~1 -- backend/prisma/schema.prisma
# 2. Create rollback migration
npx prisma migrate dev --name rollback_event_specific
# 3. Regenerate client
npx prisma generateNote: Data is preserved in event_participant_data, so you won't lose anything.
Need Help?
See detailed guides:
- MIGRATION_GUIDE.md - Full migration instructions
- IMPLEMENTATION_SUMMARY.md - Technical overview
Expected Timeline
- Data migration script: ~1 minute (for 100 participants)
- Prisma migration: ~10 seconds
- Client generation: ~5 seconds
- Container restart: ~30 seconds
Total: ~2 minutes