# Connect to your database
psql -U your_username -d your_database_name
# Run the migration
\i manual_db_migration.sql
# Or copy-paste these queries:
ALTER TABLE "events" ADD COLUMN IF NOT EXISTS "categoriesAvailable" TEXT;
ALTER TABLE "event_registrations" ADD COLUMN IF NOT EXISTS "selectedCategory" TEXT;- Open your database client
- Connect to your PostgreSQL database
- Open
manual_db_migration.sqlfile - Execute the ALTER TABLE queries
-- Check if columns were added
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'events' AND column_name = 'categoriesAvailable';
SELECT column_name, data_type
FROM information_schema.columns
WHERE table_name = 'event_registrations' AND column_name = 'selectedCategory';cd backend
# If using PM2
pm2 restart all
# Or if running directly
npm run dev
# or
node server.jscd frontend
# Stop current process (Ctrl+C) and restart
npm run build
# or for development
npm run dev- Go to your application URL
- Login as Admin or Coach (whoever creates events)
- Navigate to Events → Create Event (or edit existing event)
- Fill in event details (name, sport, dates, etc.)
- Scroll down to find the new "Categories Available" field
- Enter categories in this format:
Age Groups: Group I (11-12), Group II (13-14), Group III (15-16) Strokes: Freestyle, Backstroke, Breaststroke, Butterfly Distances: 25m, 50m, 100m - Save the event
- View the event details page
- You should see a "Categories Available" section displaying the categories you entered
- Logout from admin account
- Login as a Student/Athlete account
- Navigate to Events page
- Find the event you just created/edited (with categories)
- Click on the event to view details
- On the event details page, you should see:
- A "Categories Available" section showing the categories
- A message: "Please select your category from the options above during registration"
- Scroll to the Registration Status section (sidebar)
- You should see a "Selected Category" input field (mandatory)
- Enter your category selection, for example:
Group II (13-14) | Freestyle | 50m - Click "Register Now" button
- If payment is required, complete payment
- Registration should complete successfully
- After registration, you should see "You're registered!" message
- The registration status should update
- Login back as Admin or Coach
- Navigate to the event you created
- Click "Participants" button (or navigate to event participants page)
- You should see the participants list
- For each participant who registered with a category, you should see:
- A "Selected Category" section showing their category
- Example: "Selected Category: Group II (13-14) | Freestyle | 50m"
- In the participants modal, click "Export List" button
- A CSV file should download
- Open the CSV file
- Verify it contains a "Selected Category" column with the category data
SELECT id, name, "categoriesAvailable"
FROM events
WHERE "categoriesAvailable" IS NOT NULL;SELECT
er.id,
s.name as student_name,
e.name as event_name,
er."selectedCategory",
er.status
FROM event_registrations er
JOIN students s ON er."studentId" = s.id
JOIN events e ON er."eventId" = e.id
WHERE er."selectedCategory" IS NOT NULL;- Admin can add categories when creating/editing events
- Categories display on event details page for athletes
- Athletes see category input field during registration
- Registration requires category (if categories are set for event)
- Admin can see selected category in participant list
- Export includes selected category column
- Database stores both
categoriesAvailableandselectedCategory
-
Category field not showing:
- Check if database migration ran successfully
- Restart backend server
-
Registration fails:
- Check browser console for errors
- Verify backend logs
- Ensure category is entered if event has categories
-
Category not saving:
- Check database columns exist
- Verify backend API is receiving the data
- Check network tab in browser dev tools
- Database migration completed
- Backend restarted
- Frontend restarted
- Admin can add categories to event
- Categories display on event page
- Athlete sees category input field
- Athlete can register with category
- Admin can see category in participant list
- Export includes category column
- Database stores category data
Event Name: STAIRS Winter Open Swimming Championship 2026
Sport: Swimming
Categories Available:
Age Groups: Group I (11-12), Group II (13-14), Group III (15-16)
Strokes: Freestyle, Backstroke, Breaststroke, Butterfly
Distances: 25m, 50m, 100m
Selected Category: Group II (13-14) | Freestyle | 50m
If something doesn't work:
- Check browser console (F12) for errors
- Check backend logs for errors
- Verify database columns exist
- Ensure all services are restarted
- Clear browser cache and try again