AMBERLANDS Β· DATA SCHEMAS
Deployed Postgres model (migrations 0000β0010). Hover a table to trace its relations. Markdown + Mermaid + PlantUML twin: docs/DATA_SCHEMAS.md
Identity & campaigns
keepersthe player β email is identity
| π email | text | lowercased |
| clan_name | text | |
| tribe | text | 10 Baltic tribes |
lobbiesa campaign world = the game id
| π id | text | lobby_<hex> |
| kind | text | multi | single |
| status | text | open | running | finished |
| season_seconds | int | 15 / 30 / 60 |
| total_years | int | 20 / 30 / 60 |
| paused | bool | single: keeper owes an answer |
| last_tick_at | ts | world-clock accumulator |
| β created_by | text | keepers.email |
lobby_memberswho sits in which world
| β lobby_id | text | lobbies.id |
| β email | text | keepers.email |
The clan β living game state
clansthe actor β human keeper or AI mind
| π id | text | clan_<hex> |
| β keeper_email | text | keepers.email |
| β lobby_id | text | lobbies.id Β· null = eternal world |
| β capital_province_id | text | provinces.id |
| npc | bool | Haiku-minded rival |
| archived | bool | |
| path | text | kunigas calling |
| current_year / season | int | |
| amber grain iron vΔlΔs dovana Ε‘lovΔ | int Γ6 |
clan_membersthe bloodline
| π id | int | |
| β clan_id | text | clans.id |
| β spouse_id | int | clan_members.id Β· weddings |
| β mother_id / father_id | int | clan_members.id Β· set at birth |
| direction | text | calling: warrior trader priest farmer smith |
| role / tier / age / alive | mixed |
decisionscouncils, omens, offers β pauses singleplayer
| β clan_id | text | clans.id |
| kind | text | spring_council, diplomacy_*, β¦ |
| options | jsonb | effects applied on resolve |
| created_at | ts | 60s fate-deadline anchor |
| resolved_at | ts | null = pending |
raidswar β resolved immediately, 1/season
| β attacker_clan_id | text | clans.id |
| β target_clan_id | text | clans.id Β· null = NPC land |
| β target_province_id | text | provinces.id |
| outcome | jsonb | victory, loot, casualties |
relationsstandings between clans (sorted pair)
| β lobby_id | text | lobbies.id |
| β clan_a_id / clan_b_id | text | clans.id |
| status | text | neutral allied truce feud |
| trade | bool | pact: autumn bonus both sides |
marriagesthe marriage rolls
| β clan_id | text | clans.id |
| β husband_id / wife_id | int | clan_members.id |
| married_year | int |
eventsthe chronicle β append-only
| type | text | clan.founded, clan.raid, β¦ |
| β payload | jsonb | clans.id Β· payload.clanId (soft ref) |
| created_at | ts |
The world β static + per-campaign state
provinces45 historical lands β static, seeded
| π id | text | |
| realm | text | lithuania poland muscovy β¦ |
| foundable | bool | Baltic cradle-lands |
| description / source | text | scholarly, c. 1410 |
settlements49 period towns β static, seeded
| π id | text | |
| β province_id | text | provinces.id |
| tier | text | capital | major | town |
province_statesthe living land, per campaign
| β lobby_id | text | lobbies.id |
| β province_id | text | provinces.id |
| prosperity | int | 0-100 Β· scales harvest & loot |
| unrest | int | >60 bleeds grain |
| devastation | int | raids +15 Β· chokes yields |
settlement_statestown economy, per campaign
| β lobby_id | text | lobbies.id |
| β settlement_id | text | settlements.id |
| production | int | tier Γ prosperity per season |
| buildings | jsonb | granary 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.