Games
Catalog of all available games integrated from external game providers. Stores metadata, images, geo-restrictions, and provider configuration.
Relationships
- Associated with providers via
game_provider(logical, not FK) - Associated with transactions via
game_sessions
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | uuid | NO | gen_random_uuid() | Primary key |
name | varchar(255) | NO | Display name of the game | |
description | text | YES | Game description | |
image_url | varchar(255) | YES | Primary image URL | |
url_thumb | varchar(1024) | YES | Thumbnail image URL (used in game listings) | |
url_background | varchar(1024) | YES | Background image URL (used in game detail views) | |
type | varchar(10) | NO | Game integration type (e.g., slot, live, table) | |
provider | varchar(255) | NO | Integration provider identifier (part of composite unique key with game_code) | |
game_provider | varchar(255) | NO | The actual game studio/developer name (e.g., pragmatic, evolution). May differ from provider. | |
game_code | varchar(255) | NO | Provider-specific game identifier. Unique within a provider. | |
game_code_alias | varchar(255) | YES | Alternative game code for cross-provider compatibility | |
game_category | varchar(255) | NO | Technical game category from the provider (e.g., video-slots, table-games, live-dealer, crash) | |
is_enabled | boolean | YES | true | Whether the game is currently available to players |
is_lobby | boolean | NO | false | Whether this is a lobby game (aggregator landing page, not a real game) |
platforms | text[] | YES | '{}' | Supported platforms (e.g., desktop, mobile, tablet) |
freebet_support | boolean | YES | false | Whether the game supports free bets/bonus play |
supports_free_spins | boolean | YES | false | Whether the game supports free spin bonus rounds |
blocked_countries | text[] | YES | '{}' | Array of country codes where this game is NOT available |
blocked_override_countries | text[] | YES | '{}' | Array of country codes that can override blocked_countries. If a country is in BOTH arrays, the game IS available in that country. |
config | jsonb | YES | '{}' | Provider-specific configuration (e.g., RTP settings, launch parameters) |
created_at | timestamp | NO | CURRENT_TIMESTAMP | Record creation timestamp |
updated_at | timestamp | YES | CURRENT_TIMESTAMP | Last update timestamp |
Key Indexes
| Index | Columns | Notes |
|---|---|---|
games_pkey | id | Primary key |
games_provider_game_code_unique | provider, game_code | Unique per provider |
idx_games_game_category | game_category | Category filtering |
idx_games_game_provider | game_provider | Provider filtering |
idx_games_game_code | game_code | Code lookup |
idx_games_game_code_lookup | game_code | Partial: WHERE is_enabled = true |
idx_games_is_enabled | is_enabled | Enabled filtering |
idx_games_is_lobby | is_lobby | Lobby filtering |
idx_games_blocked_countries | blocked_countries | GIN index for array search |
idx_games_blocked_override_countries | blocked_override_countries | GIN index for array search |
idx_games_name_search | to_tsvector(name) | Full-text search (WHERE is_enabled = true) |
idx_games_category_covering | game_category, is_enabled, created_at DESC | Covering index including common SELECT columns for zero-heap reads |
idx_games_category_performance | game_category, is_enabled, created_at DESC | Partial: enabled games with thumbnails |
idx_games_listing_optimized | is_enabled, created_at DESC | Partial: enabled games with thumbnails |
idx_games_platforms | platforms | GIN index for platform search |
Business Rules
- Games are uniquely identified by the
provider + game_codecomposite key provideris the integration/aggregator whilegame_provideris the actual game studio — these may differ when using aggregators- The
blocked_override_countriesmechanism allows fine-grained geo-control: if a country appears in bothblocked_countriesandblocked_override_countries, the game is available (override wins) - Games without a
url_thumbare typically excluded from player-facing listings (reflected in partial indexes) - The extensive covering indexes on this table reflect heavy read optimization for game listing pages
- Full-text search via
idx_games_name_searchenables fast game name search