AMBERLANDS Β· DATA SCHEMAS

Deployed Postgres model (migrations 0000–0010). Hover a table to trace its relations. Markdown + Mermaid + PlantUML twin: docs/DATA_SCHEMAS.md

← game

Identity & campaigns

keepersthe player β€” email is identity
πŸ”‘ emailtextlowercased
clan_nametext
tribetext10 Baltic tribes
lobbiesa campaign world = the game id
πŸ”‘ idtextlobby_<hex>
kindtextmulti | single
statustextopen | running | finished
season_secondsint15 / 30 / 60
total_yearsint20 / 30 / 60
pausedboolsingle: keeper owes an answer
last_tick_attsworld-clock accumulator
β†’ created_bytextkeepers.email
lobby_memberswho sits in which world
β†’ lobby_idtextlobbies.id
β†’ emailtextkeepers.email

The clan β€” living game state

clansthe actor β€” human keeper or AI mind
πŸ”‘ idtextclan_<hex>
β†’ keeper_emailtextkeepers.email
β†’ lobby_idtextlobbies.id Β· null = eternal world
β†’ capital_province_idtextprovinces.id
npcboolHaiku-minded rival
archivedbool
pathtextkunigas calling
current_year / seasonint
amber grain iron vΔ—lΔ—s dovana Ε‘lovΔ—int Γ—6
clan_membersthe bloodline
πŸ”‘ idint
β†’ clan_idtextclans.id
β†’ spouse_idintclan_members.id Β· weddings
β†’ mother_id / father_idintclan_members.id Β· set at birth
directiontextcalling: warrior trader priest farmer smith
role / tier / age / alivemixed
decisionscouncils, omens, offers β€” pauses singleplayer
β†’ clan_idtextclans.id
kindtextspring_council, diplomacy_*, …
optionsjsonbeffects applied on resolve
created_atts60s fate-deadline anchor
resolved_attsnull = pending
raidswar β€” resolved immediately, 1/season
β†’ attacker_clan_idtextclans.id
β†’ target_clan_idtextclans.id Β· null = NPC land
β†’ target_province_idtextprovinces.id
outcomejsonbvictory, loot, casualties
relationsstandings between clans (sorted pair)
β†’ lobby_idtextlobbies.id
β†’ clan_a_id / clan_b_idtextclans.id
statustextneutral allied truce feud
tradeboolpact: autumn bonus both sides
marriagesthe marriage rolls
β†’ clan_idtextclans.id
β†’ husband_id / wife_idintclan_members.id
married_yearint
eventsthe chronicle β€” append-only
typetextclan.founded, clan.raid, …
β†’ payloadjsonbclans.id Β· payload.clanId (soft ref)
created_atts

The world β€” static + per-campaign state

provinces45 historical lands β€” static, seeded
πŸ”‘ idtext
realmtextlithuania poland muscovy …
foundableboolBaltic cradle-lands
description / sourcetextscholarly, c. 1410
settlements49 period towns β€” static, seeded
πŸ”‘ idtext
β†’ province_idtextprovinces.id
tiertextcapital | major | town
province_statesthe living land, per campaign
β†’ lobby_idtextlobbies.id
β†’ province_idtextprovinces.id
prosperityint0-100 Β· scales harvest & loot
unrestint>60 bleeds grain
devastationintraids +15 Β· chokes yields
settlement_statestown economy, per campaign
β†’ lobby_idtextlobbies.id
β†’ settlement_idtextsettlements.id
productioninttier Γ— prosperity per season
buildingsjsonbgranary smithy market shrine palisade

Legacy Terracon tables (untouched by the game loop): characters, stories, stats, regions, agent_memory(vector). Engine invariants: every decision resolves through resolveDecision(); every offer through createDiplomacyOffer(); NPC minds use the same paths as keepers; events.payload.clanId is a soft ref so the chronicle outlives its clans.

Data Schemas β€” The Amberlands Model