Database Documentation
Conceptual and structural documentation for the BattleScore database schema.
SQL
Schema
Core System
battlescore_dev
Overview
The BattleScore database is a relational schema supporting gameplay, army construction, tournaments, and user identity.
It is structured around a small number of core domains, each of which maps directly to system functionality.
Core hierarchy
Race
└── Faction
└── Faction Unit
└── Army Unit
└── Game Events
This hierarchy underpins army creation, imports, and scoring logic.
Domain structure
| Domain | Description |
|---|---|
| Core Data | Race → Faction → Units hierarchy |
| Army System | User-created army lists and units |
| Gameplay | Games, turns, and scoring events |
| Tournaments | Structured competition and standings |
| Identity | Users and authentication tokens |
Data flow
Reference Data
(Race/Faction/Unit)
↓
Army Lists
↓
Games
↓
Game Events
↓
Scoring / Stats
Key characteristics
- Highly relational structure
- Strong dependency on reference data integrity
- Event-driven scoring model
- Separation of reference vs transactional data
Key risks
- Reference data changes affect gameplay outcomes
- No versioning of unit definitions
- Import logic depends on string matching
- Tournament config changes may affect historical scoring
How to use this documentation
- Start with Core Data tables
- Then review Army System
- Then Gameplay tables
- Use Identity and Tournaments as supporting domains