race
Root reference-data table for game classification
SQL
Core Data
Root Entity
race
Purpose
Stores the top-level race definitions used throughout BattleScore. This is the root of the reference-data hierarchy that drives factions, unit libraries, army assignment, imports, and analytics.
Hierarchy position
race
└── factions
└── units
Columns
| Column | Type | Null | Notes |
|---|---|---|---|
id | int unsigned | No | Primary key |
name | varchar(200) | No | Race name |
created_at | datetime | No | Creation timestamp |
updated_at | datetime | No | Last update timestamp |
deleted_at | datetime | Yes | Soft delete marker |
Keys and constraints
PRIMARY KEY (id)- No unique key on
namein current schema
Relationships
| Relationship | Type | Notes |
|---|---|---|
factions.race_id → race.id |
One-to-many | Each faction belongs to one race |
army_lists.race_id → race.id |
One-to-many | Army lists may reference race directly |
Used by
- Faction selection and validation
- Army creation and editing
- Import flows requiring race selection
- Stats and reporting grouped by race
Design notes
- Soft delete is supported via
deleted_at - No uniqueness constraint currently exists on race name
- This is a low-volume but high-impact reference table
Risks
- Renaming or deleting races can affect all child factions and units conceptually
- Duplicate race names are possible unless prevented in application logic
Recommended future improvements
- Add unique constraint on
nameif business rules require it - Define clear soft delete cascade expectations for child entities
- Add audit fields if admin change tracking is required