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
idint unsignedNoPrimary key
namevarchar(200)NoRace name
created_atdatetimeNoCreation timestamp
updated_atdatetimeNoLast update timestamp
deleted_atdatetimeYesSoft delete marker

Keys and constraints

  • PRIMARY KEY (id)
  • No unique key on name in 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 name if business rules require it
  • Define clear soft delete cascade expectations for child entities
  • Add audit fields if admin change tracking is required