core PK: id 8 required 1 unique

Description

Records the enrollment and attendance of a user in a mentor workshop, tracking registration status, attendance confirmation, and participation metadata for coordinator-managed group mentoring sessions.

14
Attributes
4
Indexes
5
Validation Rules
8
CRUD Operations

Data Structure

Name Type Description Constraints
id uuid Primary key
PKrequiredunique
workshop_id uuid Foreign key to mentor_workshops
required
user_id uuid Foreign key to users — the peer mentor or coordinator participating
required
role_in_workshop enum Whether the user is a participant or a facilitator in this workshop
required
registration_status enum Current registration state
required
attended boolean Whether the participant actually attended the workshop
-
registered_at datetime Timestamp when the participant was registered
required
confirmed_at datetime Timestamp when attendance was confirmed
-
cancelled_at datetime Timestamp when registration was cancelled, if applicable
-
cancellation_reason text Optional reason provided when cancelling registration
-
notes text Coordinator notes about this participant's involvement
-
registered_by_user_id uuid User who registered this participant — may differ from user_id if coordinator registered on behalf
-
created_at datetime Record creation timestamp
required
updated_at datetime Record last update timestamp
required

Database Indexes

idx_workshop_participants_workshop_id
btree

Columns: workshop_id

idx_workshop_participants_user_id
btree

Columns: user_id

idx_workshop_participants_workshop_user
btree unique

Columns: workshop_id, user_id

idx_workshop_participants_status
btree

Columns: workshop_id, registration_status

Validation Rules

workshop_id_must_exist error

Validation failed

user_id_must_exist error

Validation failed

valid_registration_status_transition error

Validation failed

cancellation_reason_on_cancel warning

Validation failed

role_in_workshop_required error

Validation failed

Business Rules

unique_participant_per_workshop
on_create

A user can only be registered once per workshop. Duplicate registrations are rejected.

capacity_check_on_register
on_create

If the workshop has a maximum capacity set, registration beyond that limit results in waitlist status rather than confirmed registration.

coordinator_can_register_on_behalf
on_create

Coordinators may register peer mentors as participants, setting registered_by_user_id to their own user ID.

attendance_only_after_workshop_date
on_update

The attended field may only be set to true or false after the workshop's scheduled date has passed.

cancelled_participant_cannot_attend
on_update

A participant with registration_status='cancelled' cannot have attended=true.

Storage Configuration

Storage Type
primary_table
Location
main_db
Partitioning
No Partitioning
Retention
Permanent Storage