# Data Model (Initial)

Core tables defined in `apps/api/database/migrations/001_initial_schema.sql`.

## Accounts and characters

- **accounts** — login identity, settings, admin/ban flags. One account at launch; schema supports future multi-character.
- **characters** — playable entity: name, race, stats, XP subgroups, location, gold, kill counts.
- **sessions** — HttpOnly cookie sessions with expiry.
- **name_history** — moderator-visible rename audit trail.

## Content and world

- **zones** / **zone_tiles** — map definitions (Hammerfall 50×50 test world).
- **news** — admin-published announcements.

## Economy and social (schema ready, APIs in progress)

- **feedback**, **donations**, **titles**, **audit_log**

## Real-time boundary

- PHP issues one-time WebSocket tickets in Redis (`ws_ticket:{token}`).
- Go world server validates and consumes tickets on connect.
- In-world state (occupancy, movement) lives in the Go zone goroutine; periodic persistence to MySQL planned.
