Database Tables
Database schema and relationships for the events system.
Schema Discovery
The database schema can be examined through several methods:
- WordPress Database Schema
- Tables are created during plugin activation
- See
includes/class-journal-events-activator.phpfor table creation SQL
- Code References
- DataStore classes in
datastores/directory - Model classes in
models/directory define properties
- DataStore classes in
Schema Overview
je_entries
Stores entry form submissions for events.
| Column | Type | Description |
|---|---|---|
| id | mediumint(9) | Primary key |
| user_id | mediumint(9) | WordPress user ID |
| event_form_id | mediumint(9) | Reference to jc_entry_form post |
| form_data | text | JSON encoded form data |
| submission_date | datetime | When entry was submitted |
| updated_date | datetime | Last modification date |
| status | varchar(20) | Entry status (entered, waitlist, etc) |
| notes | text | Admin notes about entry |
| num_golfers | tinyint | Number of golfers in group |
Indexes:
- PRIMARY KEY (id)
- KEY user_id (user_id)
- KEY event_form_id (event_form_id)
je_profiles
Stores attendee profile information.
| Column | Type | Description |
|---|---|---|
| id | mediumint(9) | Primary key |
| user_id | mediumint(9) | WordPress user ID |
| first_name | varchar(50) | First name |
| last_name | varchar(50) | Last name |
| email_address | varchar(100) | Email address |
| phone_number | varchar(20) | Phone number |
| date_of_birth | date | Date of birth |
| gender | varchar(20) | Gender identity |
| handicap_index | varchar(5) | Golf handicap index |
| ghin | tinytext | GHIN or other handicap ID |
| home_club | tinytext | Home golf club |
| dietary_restrictions | text | Dietary requirements |
| shirt_size | varchar(4) | Shirt size (S,M,L,XL,XXL) |
| sock_size | varchar(4) | Sock size (M,L) |
| preferred_tees | varchar(10) | Preferred tee position |
| created_date | datetime | Profile creation date |
| created_by | mediumint(9) | User who created profile |
| updated_date | datetime | Last modification date |
| updated_by | mediumint(9) | User who last updated profile |
Indexes:
- PRIMARY KEY (id)
- KEY user_id (user_id)
je_attendees
Links profiles to events with role information.
| Column | Type | Description |
|---|---|---|
| id | mediumint(9) | Primary key |
| event_id | mediumint(9) | Reference to jc_event post |
| profile_id | mediumint(9) | Reference to je_profiles |
| type | varchar(20) | Attendee type (lead, playing_partner, non_playing_guest) |
| lead_id | mediumint(9) | Profile ID of lead booker (for partners/guests) |
| notes | text | Admin notes about attendee |
| created_date | datetime | Record creation date |
| updated_date | datetime | Last modification date |
Indexes:
- PRIMARY KEY (id)
- KEY event_id (event_id)
- KEY profile_id (profile_id)
- KEY lead_id (lead_id)
- KEY type (type)
je_stay_play
Stores accommodation and travel preferences.
| Column | Type | Description |
|---|---|---|
| id | mediumint(9) | Primary key |
| event_id | mediumint(9) | Reference to jc_event post |
| user_id | mediumint(9) | WordPress user ID |
| additional_nights | tinyint(1) | Wants extra nights |
| additional_night_notes | text | Details about extra nights |
| additional_rounds | tinyint(1) | Wants extra golf rounds |
| additional_rounds_notes | text | Details about extra rounds |
| transportation_details | text | Travel/transport info |
| created_date | datetime | Record creation date |
| updated_date | datetime | Last modification date |
Indexes:
- PRIMARY KEY (id)
- KEY event_id (event_id)
- KEY user_id (user_id)
Relationships
- Each
je_entriesrecord can have multipleje_attendees je_attendeeslinks toje_profilesfor attendee detailsje_stay_playrecords are linked to specificje_attendees- Guest attendees reference their lead booker through
lead_id
Related WordPress Posts
The system also uses several custom post types in the standard WordPress posts table:
- jc_event: Main event posts
- jc_entry_form: Entry/registration forms
- jc_event_profile: Profile forms
- jc_players_room: Event venue/room details
- jc_lodging: Accommodation details
These store their meta data in the standard WordPress postmeta table.