Myown
Tables (16)
actions
- id — BIGSERIAL — Primary key — NOT NULL
- turn_id — BIGINT — Foreign key → turns.id — NOT NULL
- sequence_number — INTEGER — NOT NULL
- action_type — VARCHAR(50) — NOT NULL
- action_payload — JSONB — NOT NULL
- status — VARCHAR(30) — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- resolved_at — TIMESTAMPTZ
campaign_templates
- id — BIGSERIAL — Primary key — NOT NULL
- name — VARCHAR(150) — NOT NULL
- version — INTEGER — NOT NULL
- world_context — TEXT — NOT NULL
- hard_rules — JSONB — NOT NULL
- forbidden_events — JSONB — NOT NULL
- required_story_beats — JSONB — NOT NULL
- ending_conditions — JSONB — NOT NULL
- turn_limit — INTEGER — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
characters
- id — BIGSERIAL — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- name — VARCHAR(100) — NOT NULL
- base_stats — JSONB — NOT NULL
- appearance — TEXT
- background — TEXT
- created_at — TIMESTAMPTZ — NOT NULL
dice_rolls
- id — BIGSERIAL — Primary key — NOT NULL
- turn_id — BIGINT — Foreign key → turns.id — NOT NULL
- action_id — BIGINT — Foreign key → actions.id
- raw_roll — INTEGER — NOT NULL
- stat_key — VARCHAR(100)
- stat_modifier — INTEGER — NOT NULL
- difficulty — INTEGER
- final_score — INTEGER — NOT NULL
- outcome_tier — VARCHAR(30) — NOT NULL
- rng_seed — BIGINT — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
map_tile_states
- id — BIGSERIAL — Primary key — NOT NULL
- run_id — BIGINT — Foreign key → runs.id — NOT NULL
- x — INTEGER — NOT NULL
- y — INTEGER — NOT NULL
- visited — BOOLEAN — NOT NULL
- discovered — BOOLEAN — NOT NULL
- state_override — JSONB
- event_status — VARCHAR(30)
- updated_at — TIMESTAMPTZ — NOT NULL
npc_memories
- id — BIGSERIAL — Primary key — NOT NULL
- npc_id — BIGINT — Foreign key → npcs.id — NOT NULL
- run_id — BIGINT — Foreign key → runs.id — NOT NULL
- source_turn_id — BIGINT — Foreign key → turns.id
- memory_type — VARCHAR(50) — NOT NULL
- content — TEXT — NOT NULL
- importance — INTEGER — NOT NULL
- metadata — JSONB
- created_at — TIMESTAMPTZ — NOT NULL
npcs
- id — BIGSERIAL — Primary key — NOT NULL
- run_id — BIGINT — Foreign key → runs.id — NOT NULL
- template_key — VARCHAR(100)
- name — VARCHAR(100) — NOT NULL
- role — VARCHAR(100)
- current_x — INTEGER
- current_y — INTEGER
- disposition — INTEGER — NOT NULL
- state — JSONB — NOT NULL
- status — VARCHAR(30) — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
quests
- id — BIGSERIAL — Primary key — NOT NULL
- run_id — BIGINT — Foreign key → runs.id — NOT NULL
- giver_npc_id — BIGINT — Foreign key → npcs.id
- source_turn_id — BIGINT — Foreign key → turns.id
- quest_key — VARCHAR(100) — NOT NULL
- title — VARCHAR(200) — NOT NULL
- description — TEXT
- objectives — JSONB — NOT NULL
- rewards — JSONB
- status — VARCHAR(30) — NOT NULL
- progress — JSONB — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
- completed_at — TIMESTAMPTZ
run_character_states
- run_id — BIGINT — Foreign key → runs.id — NOT NULL
- hp — INTEGER — NOT NULL
- max_hp — INTEGER — NOT NULL
- resources — JSONB — NOT NULL
- stats — JSONB — NOT NULL
- inventory — JSONB — NOT NULL
- status_effects — JSONB — NOT NULL
- experience — BIGINT — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
run_snapshots
- id — BIGSERIAL — Primary key — NOT NULL
- run_id — BIGINT — Foreign key → runs.id — NOT NULL
- turn_id — BIGINT — Foreign key → turns.id
- turn_number — INTEGER — NOT NULL
- snapshot_type — VARCHAR(30) — NOT NULL
- state_data — JSONB — NOT NULL
- state_hash — VARCHAR(128)
- created_at — TIMESTAMPTZ — NOT NULL
runs
- id — BIGSERIAL — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.id — NOT NULL
- character_id — BIGINT — Foreign key → characters.id — NOT NULL
- campaign_template_id — BIGINT — Foreign key → campaign_templates.id — NOT NULL
- campaign_version — INTEGER — NOT NULL
- world_seed — BIGINT — NOT NULL
- map_generator_version — VARCHAR(50) — NOT NULL
- status — VARCHAR(30) — NOT NULL
- current_turn — INTEGER — NOT NULL
- current_x — INTEGER — NOT NULL
- current_y — INTEGER — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
- completed_at — TIMESTAMPTZ
turn_outcomes
- id — BIGSERIAL — Primary key — NOT NULL
- turn_id — BIGINT — Foreign key → turns.id — NOT NULL
- model — VARCHAR(100) — NOT NULL
- prompt_version — VARCHAR(50) — NOT NULL
- raw_response — JSONB
- validated_effects — JSONB — NOT NULL
- narration — TEXT — NOT NULL
- validation_status — VARCHAR(30) — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
turns
- id — BIGSERIAL — Primary key — NOT NULL
- run_id — BIGINT — Foreign key → runs.id — NOT NULL
- turn_number — INTEGER — NOT NULL
- status — VARCHAR(30) — NOT NULL
- destination_x — INTEGER
- destination_y — INTEGER
- player_intent — TEXT
- context_snapshot — JSONB — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- committed_at — TIMESTAMPTZ
users
- id — BIGSERIAL — Primary key — NOT NULL
- email — VARCHAR(255) — NOT NULL
- display_name — VARCHAR(100)
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
world_facts
- id — BIGSERIAL — Primary key — NOT NULL
- run_id — BIGINT — Foreign key → runs.id — NOT NULL
- source_turn_id — BIGINT — Foreign key → turns.id
- fact_key — VARCHAR(150) — NOT NULL
- fact_value — JSONB — NOT NULL
- is_active — BOOLEAN — NOT NULL
- created_at — TIMESTAMPTZ — NOT NULL
- updated_at — TIMESTAMPTZ — NOT NULL
world_maps
- id — BIGSERIAL — Primary key — NOT NULL
- run_id — BIGINT — Foreign key → runs.id — NOT NULL
- width — INTEGER — NOT NULL
- height — INTEGER — NOT NULL
- world_seed — BIGINT — NOT NULL
- generator_version — VARCHAR(50) — NOT NULL
- generator_config — JSONB
- created_at — TIMESTAMPTZ — NOT NULL