Database
Database Schema Reference

Database Schema Reference

Complete reference of all database tables, their fields, relationships, and constraints.

Core Tables

users

The central user table storing all user information.

ColumnTypeConstraintsDescription
idBIGSERIALPRIMARY KEYUnique user identifier
telegram_idBIGINTUNIQUE, NOT NULLTelegram user ID
usernameTEXTTelegram username
first_nameTEXTUser's first name
last_nameTEXTUser's last name
photo_urlTEXTProfile picture URL
language_codeTEXTTelegram language code
is_premiumBOOLEANNOT NULL, DEFAULT FALSETelegram premium status
allows_write_to_pmBOOLEANNOT NULL, DEFAULT FALSEPM permission flag
onboarding_completedBOOLEANNOT NULL, DEFAULT FALSEOnboarding status
notifications_enabledBOOLEANNOT NULL, DEFAULT FALSENotification preference
emailVARCHARUser email address
verification_codeVARCHAREmail verification code
email_verifiedBOOLEANNOT NULL, DEFAULT FALSEEmail verification status
twitter_usernameVARCHARTwitter handle
linkedin_usernameVARCHARLinkedIn username
github_usernameVARCHARGitHub username
job_titleVARCHARProfessional title
organizationVARCHAROrganization name
rolesTEXT[]DEFAULT ''Array of user roles
ecosystemsTEXT[]DEFAULT ''Array of ecosystems
topicsTEXT[]DEFAULT ''Array of topics
experienceTEXTExperience level
locationTEXTUser location
phone_numberVARCHARPhone number
country_codeVARCHARCountry code
pog_image_urlVARCHARPOG card image URL
kgen_usernameVARCHARKGen username
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Indexes:

  • users_telegram_id_key (UNIQUE)
  • Various indexes on common query fields

Relationships:

  • One-to-one: linkedin_meta, twitter_meta, twitter_enrichments, crypto_enrichments
  • One-to-many: connections (as requester/recipient), event_attendees, conference_attendees, user_quest_tasks, user_notifications, feedback, rate_limits
  • Optional one-to-one: speakers

connections

User connection requests and status.

ColumnTypeConstraintsDescription
idBIGSERIALPRIMARY KEYConnection ID
requester_idBIGINTNOT NULL, FK → users(id)User who sent request
recipient_idBIGINTNOT NULL, FK → users(id)User who received request
statusTEXTNOT NULL, CHECK'pending', 'accepted', 'rejected'
messageTEXTConnection message
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Constraints:

  • UNIQUE (requester_id, recipient_id)
  • CHECK status IN ('pending', 'accepted', 'rejected')

Indexes:

  • idx_connections_requester_id
  • idx_connections_recipient_id

events

Event information and details.

ColumnTypeConstraintsDescription
idSERIALPRIMARY KEYEvent ID
titleVARCHAR(255)NOT NULLEvent title
slugVARCHAR(255)UNIQUEURL-friendly identifier
conference_idINTEGERFK → conferences(id)Associated conference
conference_slugVARCHARConference slug
subtitleVARCHAR(255)Event subtitle
imageVARCHAR(255)Event image URL
dateDATENOT NULLEvent date
time_descriptionVARCHAR(255)Time description
start_timeVARCHAR(50)Start time
end_timeVARCHAR(50)End time
timezoneVARCHAR(50)Timezone
organizerVARCHAR(255)NOT NULLOrganizer name
organizer_logoVARCHAR(255)Organizer logo URL
cityVARCHAR(255)Event city
descriptionTEXTEvent description
tagsTEXT[]Event tags
calendar_linkVARCHAR(255)Calendar link
registration_urlVARCHAR(255)Registration URL
location_nameVARCHAR(255)Location name
location_addressTEXTLocation address
location_latFLOATLatitude
location_lngFLOATLongitude
statusVARCHAR(20)CHECK'upcoming', 'ongoing', 'past', 'cancelled'
capacityINTEGEREvent capacity
current_attendeesINTEGERDEFAULT 0Current attendee count
waitlist_countINTEGERDEFAULT 0Waitlist count
is_featuredBOOLEANDEFAULT FALSEFeatured flag
is_paidBOOLEANDEFAULT FALSEPaid event flag
priceFLOATEvent price
currencyVARCHAR(10)Currency code
ticket_urlVARCHAR(255)Ticket URL
categoryVARCHAR(100)Event category
formatVARCHAR(20)CHECK'in-person', 'online', 'hybrid'
event_urlVARCHAR(255)Event URL
stream_urlVARCHAR(255)Stream URL
recording_urlVARCHAR(255)Recording URL
speaker_idsTEXT[]Array of speaker IDs
sponsorsJSONBSponsor information
social_sharingJSONBSocial sharing config
approval_statusVARCHAR(20)'pending', 'approved', 'rejected'
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Indexes:

  • idx_events_status
  • idx_events_date
  • idx_events_featured
  • idx_events_conference_id
  • idx_events_slug

Relationships:

  • Many-to-one: conferences (via conference_id)
  • One-to-many: event_attendees, event_speakers

event_attendees

Event attendance tracking.

ColumnTypeConstraintsDescription
idSERIALPRIMARY KEYAttendee record ID
event_idINTEGERNOT NULL, FK → events(id)Event ID
user_idINTEGERNOT NULL, FK → users(id)User ID
statusVARCHAR(20)CHECK, DEFAULT 'attending''attending', 'waitlisted', 'cancelled'
registered_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Registration timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Constraints:

  • UNIQUE (event_id, user_id)
  • CHECK status IN ('attending', 'waitlisted', 'cancelled')

Indexes:

  • idx_event_attendees_event_id
  • idx_event_attendees_user_id
  • idx_event_attendees_status

conferences

Conference information and configuration.

ColumnTypeConstraintsDescription
idSERIALPRIMARY KEYConference ID
slugVARCHAR(255)UNIQUE, NOT NULLURL-friendly identifier
nameVARCHAR(255)NOT NULLConference name
taglineVARCHAR(500)Conference tagline
descriptionTEXTFull description
short_descriptionVARCHAR(1000)Short description
logo_urlVARCHAR(500)Logo URL
banner_urlVARCHAR(500)Banner URL
hero_image_urlVARCHAR(500)Hero image URL
favicon_urlVARCHAR(500)Favicon URL
start_dateDATEStart date
end_dateDATEEnd date
timezoneVARCHAR(50)DEFAULT 'UTC'Timezone
statusVARCHAR(20)CHECK, DEFAULT 'draft''upcoming', 'ongoing', 'past', 'cancelled', 'draft'
cityVARCHAR(255)City
countryVARCHAR(255)Country
venue_nameVARCHAR(255)Venue name
venue_addressTEXTVenue address
venue_latFLOATVenue latitude
venue_lngFLOATVenue longitude
is_virtualBOOLEANDEFAULT FALSEVirtual conference flag
virtual_platformVARCHAR(100)Virtual platform
virtual_urlVARCHAR(500)Virtual URL
organizer_nameVARCHAR(255)NOT NULLOrganizer name
organizer_logoVARCHAR(500)Organizer logo
organizer_websiteVARCHAR(500)Organizer website
organizer_emailVARCHAR(255)Organizer email
organizer_phoneVARCHAR(50)Organizer phone
website_urlVARCHAR(500)Website URL
twitter_urlVARCHAR(500)Twitter URL
linkedin_urlVARCHAR(500)LinkedIn URL
instagram_urlVARCHAR(500)Instagram URL
facebook_urlVARCHAR(500)Facebook URL
youtube_urlVARCHAR(500)YouTube URL
telegram_urlVARCHAR(500)Telegram URL
discord_urlVARCHAR(500)Discord URL
registration_urlVARCHAR(500)Registration URL
ticket_urlVARCHAR(500)Ticket URL
is_freeBOOLEANDEFAULT TRUEFree conference flag
price_rangeVARCHAR(100)Price range
currencyVARCHAR(10)DEFAULT 'USD'Currency
max_attendeesINTEGERMaximum attendees
current_attendeesINTEGERDEFAULT 0Current attendee count
is_featuredBOOLEANDEFAULT FALSEFeatured flag
is_publicBOOLEANDEFAULT TRUEPublic visibility flag
requires_approvalBOOLEANDEFAULT FALSEApproval required flag
is_activeBOOLEANDEFAULT TRUEActive status
theme_colorVARCHAR(7)Theme color
secondary_colorVARCHAR(7)Secondary color
custom_cssTEXTCustom CSS
custom_jsTEXTCustom JavaScript
meta_titleVARCHAR(255)SEO meta title
meta_descriptionVARCHAR(500)SEO meta description
meta_keywordsTEXT[]SEO keywords
og_imageVARCHAR(500)Open Graph image
google_analytics_idVARCHAR(50)Google Analytics ID
facebook_pixel_idVARCHAR(50)Facebook Pixel ID
custom_tracking_codeTEXTCustom tracking code
sponsorship_prospectus_urlVARCHAR(500)Sponsorship prospectus
sponsor_contact_emailVARCHAR(255)Sponsor contact email
tagsTEXT[]Conference tags
categoriesTEXT[]Conference categories
languagesTEXT[]DEFAULT ARRAY['English']Supported languages
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp
created_byBIGINTFK → users(id)Creator user ID
updated_byBIGINTFK → users(id)Updater user ID

Indexes:

  • idx_conferences_slug (UNIQUE)
  • idx_conferences_status
  • idx_conferences_start_date
  • idx_conferences_featured
  • idx_conferences_public
  • idx_conferences_city
  • idx_conferences_organizer

Relationships:

  • One-to-many: events, conference_attendees, conference_speakers, conference_agenda, quests

conference_attendees

Conference attendance tracking.

ColumnTypeConstraintsDescription
idSERIALPRIMARY KEYAttendee record ID
user_idBIGINTNOT NULL, FK → users(id)User ID
conference_idINTEGERNOT NULL, FK → conferences(id)Conference ID
registration_dateTIMESTAMPTZNOT NULL, DEFAULT NOW()Registration date
statusVARCHAR(20)CHECK, DEFAULT 'registered''registered', 'attended', 'cancelled'
emailVARCHARAttendee email
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Constraints:

  • UNIQUE (user_id, conference_id)
  • CHECK status IN ('registered', 'attended', 'cancelled')

Indexes:

  • idx_conference_attendees_user_id
  • idx_conference_attendees_conference_id
  • idx_conference_attendees_status
  • idx_conference_attendees_registration_date

conference_agenda

Conference agenda/schedule items.

ColumnTypeConstraintsDescription
idSERIALPRIMARY KEYAgenda item ID
conference_idINTEGERFK → conferences(id)Conference ID
day_dateDATENOT NULLAgenda day
stage_nameVARCHAR(255)NOT NULLStage/room name
time_slotVARCHAR(100)NOT NULLTime slot
event_nameVARCHAR(500)NOT NULLEvent/session name
speakers_dataTEXTSemicolon-separated speaker info
speaker_image_urlTEXTSemicolon-separated speaker image URLs
org_image_urlTEXTSemicolon-separated org image URLs
display_orderINTEGERNOT NULL, DEFAULT 0Display order
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Indexes:

  • idx_conference_agenda_conference_id
  • idx_conference_agenda_day_date
  • idx_conference_agenda_stage_name
  • idx_conference_agenda_conference_day_stage
  • idx_conference_agenda_display_order

speakers

Speaker information and profiles.

ColumnTypeConstraintsDescription
idSERIALPRIMARY KEYSpeaker ID
first_nameVARCHAR(100)NOT NULLFirst name
last_nameVARCHAR(100)NOT NULLLast name
emailVARCHAR(255)UNIQUEEmail address
phoneVARCHAR(20)Phone number
bioTEXTBiography
titleVARCHAR(200)Professional title
organizationVARCHAR(200)Organization
photo_urlVARCHAR(500)Photo URL
websiteVARCHAR(500)Website URL
linkedin_urlVARCHAR(500)LinkedIn URL
twitter_urlVARCHAR(500)Twitter URL
github_urlVARCHAR(500)GitHub URL
instagram_urlVARCHAR(500)Instagram URL
facebook_urlVARCHAR(500)Facebook URL
youtube_urlVARCHAR(500)YouTube URL
personal_websiteVARCHAR(500)Personal website
locationVARCHAR(200)Location
countryVARCHAR(100)Country
cityVARCHAR(100)City
languagesTEXT[]Languages spoken
expertiseTEXT[]Areas of expertise
topicsTEXT[]Speaking topics
experienceTEXTExperience description
educationTEXTEducation background
certificationsTEXT[]Certifications
availabilityTEXTAvailability
travel_willingBOOLEANDEFAULT FALSEWilling to travel
virtual_willingBOOLEANDEFAULT TRUEWilling for virtual
fee_rangeVARCHAR(100)Fee range
currencyVARCHAR(3)DEFAULT 'USD'Currency
is_verifiedBOOLEANDEFAULT FALSEVerification status
is_activeBOOLEANDEFAULT TRUEActive status
is_featuredBOOLEANDEFAULT FALSEFeatured flag
ratingFLOATDEFAULT 0Average rating
rating_countINTEGERDEFAULT 0Rating count
total_talksINTEGERDEFAULT 0Total talks given
total_eventsINTEGERDEFAULT 0Total events
last_talk_dateTIMESTAMPTZLast talk date
user_idBIGINTFK → users(id)Associated user ID
slugVARCHAR(255)URL-friendly identifier
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Indexes:

  • idx_speakers_email (UNIQUE)
  • idx_speakers_is_active
  • idx_speakers_is_featured
  • idx_speakers_is_verified
  • idx_speakers_country
  • idx_speakers_city
  • GIN indexes on expertise, topics, languages

Relationships:

  • Optional many-to-one: users (via user_id)
  • Many-to-many: events (via event_speakers), conferences (via conference_speakers)

event_speakers

Junction table for event-speaker relationships.

ColumnTypeConstraintsDescription
idSERIALPRIMARY KEYRelationship ID
event_idBIGINTNOT NULL, FK → events(id)Event ID
speaker_idBIGINTNOT NULL, FK → speakers(id)Speaker ID
roleVARCHAR(100)Speaker role (keynote, panelist, etc.)
orderINTEGERDEFAULT 0Display order
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Constraints:

  • UNIQUE (event_id, speaker_id)

Indexes:

  • idx_event_speakers_event_id
  • idx_event_speakers_speaker_id
  • idx_event_speakers_role

conference_speakers

Junction table for conference-speaker relationships.

ColumnTypeConstraintsDescription
idSERIALPRIMARY KEYRelationship ID
conference_idBIGINTNOT NULL, FK → conferences(id)Conference ID
speaker_idBIGINTNOT NULL, FK → speakers(id)Speaker ID
roleVARCHAR(100)Speaker role
orderINTEGERDEFAULT 0Display order
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Constraints:

  • UNIQUE (conference_id, speaker_id)

Indexes:

  • idx_conference_speakers_conference_id
  • idx_conference_speakers_speaker_id
  • idx_conference_speakers_role

Quest System Tables

quests

Quest/gamification system.

ColumnTypeConstraintsDescription
idVARCHAR(255)PRIMARY KEYQuest ID
titleVARCHAR(255)NOT NULLQuest title
subtitleVARCHAR(255)Quest subtitle
descriptionTEXTQuest description
tagVARCHAR(50)Quest tag
categoryVARCHAR(50)Quest category
conference_idINTEGERFK → conferences(id)Associated conference
conference_slugVARCHARConference slug
rewardVARCHAR(255)Reward description
reward_descriptionTEXTDetailed reward description
reward_imageVARCHAR(255)Reward image URL
pointsINTNOT NULLPoints awarded
points_disabledBOOLEANPoints disabled flag
deadlineTIMESTAMPQuest deadline
sponsorVARCHAR(255)Sponsor name
sponsor_logoVARCHAR(255)Sponsor logo URL
sponsor_websiteVARCHAR(255)Sponsor website
featuredBOOLEANDEFAULT FALSEFeatured flag
is_activeBOOLEANActive status
background_colorVARCHAR(50)Background color
border_colorVARCHAR(50)Border color
difficultyVARCHAR(50)Difficulty level
estimated_completion_timeVARCHAR(50)Estimated time
quest_typeVARCHAR(50)Quest type
raffle_draw_dateTIMESTAMPRaffle draw date
registration_approval_requiredBOOLEANDEFAULT FALSEApproval required
approval_form_fieldsJSONBApproval form fields
copiesJSONBReward copies/template
kgen_questBOOLEANKGen quest flag
created_atTIMESTAMPNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPNOT NULL, DEFAULT NOW()Update timestamp

Indexes:

  • idx_quests_featured
  • idx_quests_category

Relationships:

  • Many-to-one: conferences (via conference_id)
  • One-to-many: quest_tasks, user_quest_tasks, quest_registration_requests, quest_notification_templates

quest_tasks

Tasks within quests.

ColumnTypeConstraintsDescription
idVARCHAR(255)PRIMARY KEYTask ID
quest_idVARCHAR(255)NOT NULL, FK → quests(id)Quest ID
typeVARCHAR(50)NOT NULLTask type
descriptionVARCHAR(255)NOT NULLTask description
detail_descriptionTEXTDetailed description
pointsINTNOT NULLPoints for completion
action_typeVARCHAR(50)Action type
action_urlTEXTAction URL
verification_typeVARCHAR(50)Verification method
iconVARCHAR(50)Icon identifier
repeatableBOOLEANDEFAULT FALSERepeatable flag
repeat_frequencyVARCHAR(50)Repeat frequency
start_dateTIMESTAMPStart date
end_dateTIMESTAMPEnd date
is_mandatoryBOOLEANDEFAULT FALSEMandatory flag
time_estimateVARCHAR(50)Time estimate
platformVARCHAR(50)Platform
required_hashtagsJSONBRequired hashtags
suggested_textTEXTSuggested text
tipsTEXTTips
exampleTEXTExample
unlock_conditionJSONBUnlock conditions
metadataJSONBFlexible metadata (quiz, poll, etc.)
proof_requiredBOOLEANProof required flag
created_atTIMESTAMPNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPNOT NULL, DEFAULT NOW()Update timestamp

Indexes:

  • idx_quest_tasks_quest_id

Relationships:

  • Many-to-one: quests (via quest_id)
  • One-to-many: user_quest_tasks

user_quest_tasks

User progress on quest tasks.

ColumnTypeConstraintsDescription
idVARCHAR(255)PRIMARY KEYProgress record ID
user_idBIGINTNOT NULL, FK → users(id)User ID
quest_idVARCHAR(255)NOT NULL, FK → quests(id)Quest ID
quest_task_idVARCHAR(255)NOT NULL, FK → quest_tasks(id)Task ID
completedBOOLEANDEFAULT FALSECompletion status
completed_atTIMESTAMPCompletion timestamp
verified_atTIMESTAMPVerification timestamp
points_earnedINTDEFAULT 0Points earned
proofTEXTProof of completion
metadataJSONBApproval/rejection metadata
created_atTIMESTAMPNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPNOT NULL, DEFAULT NOW()Update timestamp

Constraints:

  • UNIQUE (user_id, quest_task_id)

Indexes:

  • idx_user_quest_tasks_user_id
  • idx_user_quest_tasks_quest_id
  • idx_user_quest_tasks_completed
  • idx_user_quest_tasks_completed_at

quest_registration_requests

Quest registration approval requests.

ColumnTypeConstraintsDescription
idUUIDPRIMARY KEYRequest ID
user_idBIGINTNOT NULL, FK → users(id)User ID
quest_idVARCHAR(255)NOT NULL, FK → quests(id)Quest ID
statusVARCHAR(20)DEFAULT 'pending''pending', 'approved', 'rejected'
form_dataJSONBForm submission data
admin_notesTEXTAdmin notes
messageTEXTMessage to participant
rewardJSONBReward assigned to user
processed_byBIGINTFK → users(id)Admin who processed
processed_atTIMESTAMPProcessing timestamp
created_atTIMESTAMPDEFAULT NOW()Creation timestamp
updated_atTIMESTAMPDEFAULT NOW()Update timestamp

Constraints:

  • UNIQUE (user_id, quest_id)

Indexes:

  • idx_quest_registration_requests_user_id
  • idx_quest_registration_requests_quest_id
  • idx_quest_registration_requests_status
  • idx_quest_registration_requests_created_at

quest_notification_templates

Quest reminder notification templates.

ColumnTypeConstraintsDescription
idUUIDPRIMARY KEYTemplate ID
quest_idVARCHAR(255)NOT NULL, FK → quests(id)Quest ID
template_nameVARCHAR(100)NOT NULL, DEFAULT 'default'Template name
is_defaultBOOLEANDEFAULT FALSEDefault template flag
status_payloadsJSONBNOT NULLNotification payloads per stage
created_byBIGINTFK → users(id)Creator user ID
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp
updated_byBIGINTFK → users(id)Updater user ID

Constraints:

  • UNIQUE (quest_id, template_name)

Indexes:

  • idx_quest_notification_templates_quest_id
  • idx_quest_notification_templates_default

Notification System Tables

user_notifications

User notifications.

ColumnTypeConstraintsDescription
idUUIDPRIMARY KEYNotification ID
user_idBIGINTNOT NULL, FK → users(id)User ID
typeVARCHAR(50)NOT NULLNotification type
titleVARCHAR(255)NOT NULLNotification title
messageTEXTNOT NULLNotification message
is_clickedBOOLEANDEFAULT FALSEClicked status
is_dismissedBOOLEANDEFAULT FALSEDismissed status
action_dataJSONBAction data
created_atTIMESTAMPDEFAULT NOW()Creation timestamp
updated_atTIMESTAMPDEFAULT NOW()Update timestamp

Indexes:

  • idx_user_notifications_user_id
  • idx_user_notifications_type
  • idx_user_notifications_created_at
  • idx_user_notifications_is_clicked
  • idx_user_notifications_is_dismissed

notification_jobs

Bulk notification job tracking.

ColumnTypeConstraintsDescription
idUUIDPRIMARY KEYJob ID
created_byBIGINTFK → users(id)Creator user ID
selection_criteriaJSONBNOT NULLUser selection criteria
notification_payloadJSONBNOT NULLNotification payload
statusVARCHAR(20)NOT NULL, DEFAULT 'pending', CHECK'pending', 'processing', 'completed', 'failed'
total_usersINTEGERNOT NULL, DEFAULT 0Total eligible users
attempted_countINTEGERNOT NULL, DEFAULT 0Attempted count
success_countINTEGERNOT NULL, DEFAULT 0Success count
failure_countINTEGERNOT NULL, DEFAULT 0Failure count
error_messageTEXTError message
scheduled_atTIMESTAMPTZScheduled time
started_atTIMESTAMPTZStart timestamp
completed_atTIMESTAMPTZCompletion timestamp
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Indexes:

  • idx_notification_jobs_status
  • idx_notification_jobs_created_at
  • idx_notification_jobs_created_by

Relationships:

  • One-to-many: notification_job_items

notification_job_items

Individual notification attempts within a job.

ColumnTypeConstraintsDescription
idUUIDPRIMARY KEYItem ID
job_idUUIDNOT NULL, FK → notification_jobs(id)Job ID
user_idBIGINTNOT NULL, FK → users(id)User ID
telegram_idBIGINTNOT NULLTelegram ID
statusVARCHAR(20)NOT NULL, DEFAULT 'pending', CHECK'pending', 'processing', 'success', 'failed'
error_messageTEXTError message
sent_atTIMESTAMPTZSent timestamp
template_variablesJSONBTemplate variables used
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Constraints:

  • UNIQUE (job_id, user_id)

Indexes:

  • idx_notification_job_items_job_id
  • idx_notification_job_items_user_id
  • idx_notification_job_items_status

Enrichment Tables

linkedin_meta

LinkedIn profile metadata.

ColumnTypeConstraintsDescription
idBIGSERIALPRIMARY KEYRecord ID
user_idBIGINTNOT NULL, UNIQUE, FK → users(id)User ID
profile_dataJSONBNOT NULL, DEFAULT ''LinkedIn profile data
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Relationships:

  • One-to-one: users

twitter_meta

Twitter profile metadata.

ColumnTypeConstraintsDescription
idBIGSERIALPRIMARY KEYRecord ID
user_idBIGINTNOT NULL, UNIQUE, FK → users(id)User ID
profile_dataJSONBNOT NULL, DEFAULT ''Twitter profile data
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Relationships:

  • One-to-one: users

twitter_tweets

User tweets.

ColumnTypeConstraintsDescription
idBIGSERIALPRIMARY KEYTweet ID
user_idBIGINTNOT NULL, FK → users(id)User ID
usernameVARCHARTwitter username
tweet_dataJSONBTweet data
created_atTIMESTAMPTweet timestamp

Relationships:

  • Many-to-one: users

twitter_enrichments

AI-generated Twitter enrichments.

ColumnTypeConstraintsDescription
idBIGSERIALPRIMARY KEYEnrichment ID
user_idBIGINTNOT NULL, UNIQUE, FK → users(id)User ID
topic_expertiseJSONBNOT NULL, DEFAULT ''Topic expertise
project_affiliationsJSONBNOT NULL, DEFAULT ''Project affiliations
crypto_roleVARCHAR(255)Crypto role
key_stancesJSONBNOT NULL, DEFAULT ''Key stances
community_signalsJSONBNOT NULL, DEFAULT ''Community signals
activity_profileJSONBNOT NULL, DEFAULT ''Activity profile
tagsJSONBNOT NULL, DEFAULT ''Tags
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Relationships:

  • One-to-one: users

crypto_enrichments

Combined crypto enrichments from multiple sources.

ColumnTypeConstraintsDescription
idBIGSERIALPRIMARY KEYEnrichment ID
user_idBIGINTNOT NULL, UNIQUE, FK → users(id)User ID
primary_chainsJSONBNOT NULL, DEFAULT ''Primary chains
expertise_areasJSONBNOT NULL, DEFAULT ''Expertise areas
networking_pitchTEXTNetworking pitch
collab_interestsJSONBNOT NULL, DEFAULT ''Collaboration interests
profile_typeVARCHAR(255)Profile type
sources_usedJSONBNOT NULL, DEFAULT ''Sources used
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Update timestamp

Relationships:

  • One-to-one: users

Utility Tables

rate_limits

API rate limiting tracking.

ColumnTypeConstraintsDescription
idBIGSERIALPRIMARY KEYRecord ID
user_idBIGINTNOT NULL, FK → users(id)User ID
endpointVARCHAR(255)NOT NULLEndpoint path
request_countINTEGERNOT NULL, DEFAULT 1Request count
window_startTIMESTAMPTZNOT NULLRate limit window start
created_atTIMESTAMPTZDEFAULT NOW()Creation timestamp
updated_atTIMESTAMPTZDEFAULT NOW()Update timestamp

Indexes:

  • idx_rate_limits_user_endpoint_window
  • idx_rate_limits_window_start

feedback

User feedback submissions.

ColumnTypeConstraintsDescription
idSERIALPRIMARY KEYFeedback ID
user_idBIGINTNOT NULL, FK → users(id)User ID
feedbackTEXTNOT NULLFeedback text
created_atTIMESTAMPTZNOT NULL, DEFAULT NOW()Creation timestamp

Indexes:

  • idx_feedback_user_id
  • idx_feedback_created_at

Summary Statistics

  • Total Tables: 25+
  • Core Tables: 5 (users, events, conferences, quests, speakers)
  • Junction Tables: 5 (connections, event_attendees, conference_attendees, event_speakers, conference_speakers)
  • Enrichment Tables: 4 (linkedin_meta, twitter_meta, twitter_enrichments, crypto_enrichments)
  • Quest System Tables: 4 (quests, quest_tasks, user_quest_tasks, quest_registration_requests)
  • Notification Tables: 3 (user_notifications, notification_jobs, notification_job_items)
  • Utility Tables: 2 (rate_limits, feedback)
  • Total Indexes: 100+
  • Foreign Key Constraints: 30+