Skip to main content

Players

The central user table storing all player account information, personal details, verification statuses, and preferences.

Relationships

Columns

ColumnTypeNullableDefaultDescription
iduuidNOgen_random_uuid()Primary key
emailvarchar(255)NOPlayer's email address. Unique per brand (email + brand_id composite unique).
passwordvarchar(255)YESHashed password. NULL for social login accounts.
first_namevarchar(255)YESPlayer's first name
last_namevarchar(255)YESPlayer's last name
titlevarchar(10)YESHonorific title (Mr, Mrs, etc.)
gendervarchar(10)NO'UNKNOWN'Player gender. Values: MALE, FEMALE, UNKNOWN
birthdatedateYESDate of birth (used for age verification and VIP birthday gifts)
phonevarchar(20)YESPhone number
countryvarchar(3)YESISO 3166-1 alpha-2/3 country code
statevarchar(3)YESUS state code (relevant for sweepstakes geo-restrictions)
addressvarchar(255)YESStreet address
cityvarchar(100)YESCity
zip_codevarchar(20)YESPostal/ZIP code
brand_iduuidNOFK to brands. Which brand the player registered under.
company_iduuidNOFK to companies. Parent company of the brand.
account_statusvarchar(50)YES'PENDING'Account lifecycle status. Values: PENDING, ACTIVE, SUSPENDED, CLOSED
is_verifiedbooleanYESfalseOverall verification flag
is_kyc_verifiedbooleanYESfalseKYC (Know Your Customer) verification complete
kyc_statusvarchar(50)YES'not_started'KYC verification workflow status. Values: not_started, pending, approved, rejected
kyc_applicant_idvarchar(255)YESExternal KYC provider applicant identifier
kyc_triggered_attimestamptzYESWhen KYC verification was initiated
kyc_completed_attimestamptzYESWhen KYC verification was completed
address_verifiedbooleanYESfalseAddress verification status
address_confirmed_attimestamptzYESWhen address was confirmed
personal_details_confirmed_attimestamptzYESWhen personal details were confirmed
terms_acceptedbooleanNOfalseWhether the player accepted terms and conditions
email_verifiedbooleanNOfalseWhether the player's email has been verified
phone_verifiedbooleanYESfalseWhether the player's phone has been verified
can_withdrawbooleanYESfalseWhether the player is allowed to withdraw funds. Managed by the sync_can_withdraw trigger.
can_purchasebooleanYESfalseWhether the player is allowed to make purchases
first_purchase_datetimestampYESTimestamp of the player's first purchase
first_purchase_transaction_iduuidYESFK to transactions. Links to the first deposit/purchase transaction.
social_providervarchar(50)YESOAuth provider name (e.g., google, facebook)
social_provider_idvarchar(255)YESExternal ID from the social provider
wallet_currencyvarchar(3)YES'EUR'Player's wallet display currency
preferred_currency_typevarchar(20)YES'real_money'User currency preference: real_money (regular casinos), sweepstakes (legacy), gc (Gold Coins), or sc (Sweepstakes Coins)
user_languagechar(2)YES'EN'Player's preferred language (ISO 639-1)
consecutive_login_daysintegerYES0Tracks how many consecutive days the player has logged in. Used by the daily login rewards system.
last_login_datetimestampYESTimestamp of the player's most recent login
ipinetYESLast known IP address
browservarchar(100)YESLast known browser user-agent
osvarchar(100)YESLast known operating system
is_test_accountbooleanNOfalseIndicates whether this is a test/QA account (excluded from reporting)
affiliate_idnumericYESLegacy numeric affiliate identifier
affiliate_strvarchar(255)YESLegacy affiliate string identifier
email_disabled_by_platformbooleanYESfalseWhether marketing emails were disabled by the platform
sms_disabled_by_platformbooleanYESfalseWhether marketing SMS was disabled by the platform
redeemable_scnumeric(18)NO0Amount of SC (Sweepstakes Coins) eligible for redemption. Only SC that has been wagered (bet or won from betting) qualifies. Maintained automatically by triggers. Always <= current SC withdrawable balance.
metadatajsonbYESFlexible JSON metadata for additional player data
created_attimestampYESCURRENT_TIMESTAMPAccount creation timestamp
updated_attimestampYESLast update timestamp (managed by update_updated_at trigger)

Triggers

TriggerFunctionDescription
trigger_update_updated_atupdate_updated_atAutomatically sets updated_at on row update
trigger_sync_can_withdrawsync_can_withdrawSynchronizes the can_withdraw flag based on verification status
trigger_log_user_status_changeslog_user_status_changesLogs changes to account_status for audit
trigger_log_first_time_actionslog_first_time_actionsLogs first-time events (first login, first purchase, etc.)

Key Indexes

IndexColumnsNotes
players_pkeyidPrimary key
players_email_brand_id_keyemail, brand_idUnique - one email per brand
idx_players_brand_idbrand_idBrand lookup
idx_players_auth_fastid, account_statusPartial: WHERE account_status = 'ACTIVE'
idx_players_kyc_statuskyc_statusKYC filtering
idx_players_redeemable_scredeemable_scPartial: WHERE redeemable_sc > 0
idx_players_is_test_accountis_test_accountFilter test accounts

Business Rules

  • A player's email is unique within a brand but can exist across multiple brands
  • The redeemable_sc field is automatically maintained by database triggers on the transactions and player_balances tables
  • The can_withdraw flag is synced via triggers based on KYC and verification status
  • consecutive_login_days resets to 0 if the player misses a day, driving the daily login rewards system