Data model
Authoritative schema: server/prisma/schema.prisma (Prisma 6).
All models
| Model | Purpose |
|---|---|
Admin | Admin accounts |
AdminSettings | Per-admin settings |
User | Participant records (linked to experiments) |
ConstantSetting | Tunable platform constants |
Experiment | University experiment definition + secret join code |
GameSession | Unified room (experiment / friends / solo) |
PlayerSession | Per-player session token / reconnect state |
SurveyResponse | Typed survey answers per user |
ExitSurvey | Exit survey payload |
SinglePlayerForaging | SP foraging results |
MultiplayerForaging | MP foraging aggregates |
MultiplayerForagingRound | Per-round MP metrics (keyed by expID string) |
ArithmeticTest | Arithmetic stress results |
PracticeSession | Friends/solo practice data (separate from official experiment) |
SimulationRun | Bot simulation job |
SimulationRound | Rounds within a simulation |
SimulationBotResult | Per-bot outcomes in a round |
Core session graph
Used for live rooms and reconnect:
GameSession.experimentIdis nullable — friends/solo rooms have no experiment.PlayerSessionlinks toGameSessionbyroomCode(not numeric id).MultiplayerForagingRoundis not a Prisma relation toExperiment/GameSession; it stores anexpIDstring used by export/analysis code.
Simulation subgraph
Statuses on SimulationRun include pending, running, complete, failed, cancelled.
Survey and foraging data
- Official surveys:
SurveyResponse(@@unique([userId, type])) plusExitSurvey - Gameplay tables:
SinglePlayerForaging,MultiplayerForaging,ArithmeticTest - Practice (non-experiment):
PracticeSessionindexed byroomCode
Export jobs and the data dictionary (Phase 2) document column-level meaning for analysis.