Alembic Migrations¶
Source: services/gameserver/alembic/versions/
Current head: f4a5b6c7d8e9 — add ARIA consciousness fields to players.
Initial revision: c138b33baec4 — initial schema with stations terminology.
There is one head; no pending divergent branches. The chain is linear except for one merge revision that joins the genesis-formation and terraforming branches.
Chain (initial → head)¶
c138b33baec4 initial schema with stations terminology
└── e86cb8130b5b rename_all_port_columns_to_station
└── dbbfad27a7ef change planet population columns to bigint
└── fe22441146b1 add personal reputation and military rank to players
└── c5e32c313020 update_ship_thresholds_for_balanced_gameplay
└── ec92f8afd44a add_guard_personality_to_first_login_sessions
└── 6b1d95a38c98 tighten_scout_ship_thresholds_for_strict_consistency
└── 6acc65ee7a72 add_ai_logging_fields_to_dialogue_exchange
└── 2e78250f47bc lower_scout_ship_thresholds_for_balanced_gameplay
└── 5f5a988bdbb1 add current_port_id and current_planet_id to players
├── a3f7c2d91e54 add genesis formation columns to planets
└── a1b2c3d4e5f6 add planet morale and siege_turns columns
└── b2c3d4e5f6a7 add terraforming columns to planets
└── (merge)
c1d2e3f4a5b6 merge genesis and terraforming heads
└── d2e3f4a5b6c7 add attack_turn_cost and equipment_slots to ships
└── e3f4a5b6c7d8 add citadel fields to planets
└── f4a5b6c7d8e9 add ARIA consciousness fields to players ← HEAD
Revisions¶
| Revision | File | Purpose |
|---|---|---|
c138b33baec4 |
c138b33baec4_initial_schema_with_stations_terminology.py |
Initial schema; uses stations (not ports) as the primary terminology from the start. |
e86cb8130b5b |
e86cb8130b5b_rename_all_port_columns_to_station.py |
Renames residual port_* columns/tables to station_* for consistency. |
dbbfad27a7ef |
dbbfad27a7ef_change_planet_population_columns_to_.py |
Widens planets.population, max_population, citadel population columns to BigInteger. |
fe22441146b1 |
fe22441146b1_add_personal_reputation_and_military_.py |
Adds Player.personal_reputation, reputation_tier, name_color, military_rank, rank_points. |
c5e32c313020 |
c5e32c313020_update_ship_thresholds_for_balanced_.py |
Rebalances ship_rarity_configs thresholds. |
ec92f8afd44a |
ec92f8afd44a_add_guard_personality_to_first_login_.py |
Adds guard personality columns (guard_name, guard_title, guard_trait, guard_base_suspicion, guard_description) to first_login_sessions. |
6b1d95a38c98 |
6b1d95a38c98_tighten_scout_ship_thresholds_for_.py |
Tightens scout-ship rarity thresholds. |
6acc65ee7a72 |
6acc65ee7a72_add_ai_logging_fields_to_dialogue_.py |
Adds AI provider/prompt/response/cost/tokens columns to dialogue_exchanges. |
2e78250f47bc |
2e78250f47bc_lower_scout_ship_thresholds_for_.py |
Further scout threshold rebalance. |
5f5a988bdbb1 |
5f5a988bdbb1_add_current_port_id_and_current_planet_.py |
Adds Player.current_port_id and current_planet_id for docked/landed state. |
a3f7c2d91e54 |
a3f7c2d91e54_add_genesis_formation_columns_to_planets.py |
Adds genesis_created, genesis_device_id, genesis_tier, formation_status, formation_started_at, formation_complete_at on planets. |
a1b2c3d4e5f6 |
a1b2c3d4e5f6_add_planet_morale_and_siege_turns.py |
Adds siege state columns (under_siege, siege_started_at, siege_attacker_id) and morale-related fields to planets. |
b2c3d4e5f6a7 |
b2c3d4e5f6a7_add_terraforming_columns_to_planets.py |
Adds terraforming columns to planets (parallel branch with the genesis-formation work). |
c1d2e3f4a5b6 |
c1d2e3f4a5b6_merge_genesis_and_terraforming_heads.py |
Merge revision joining a3f7c2d91e54 and b2c3d4e5f6a7 back into a single head. |
d2e3f4a5b6c7 |
d2e3f4a5b6c7_add_attack_turn_cost_and_equipment_slots.py |
Adds Ship.attack_turn_cost and Ship.equipment_slots; mirrors attack_turn_cost on ship_specifications. |
e3f4a5b6c7d8 |
e3f4a5b6c7d8_add_citadel_fields_to_planets.py |
Adds citadel columns: citadel_level, citadel_upgrading, citadel_upgrade_started_at, citadel_upgrade_complete_at, citadel_safe_credits, citadel_safe_max, citadel_drone_capacity, citadel_max_population. |
f4a5b6c7d8e9 |
f4a5b6c7d8e9_add_aria_fields_to_players.py |
HEAD — Adds aria_bonus_multiplier, aria_consciousness_level, aria_relationship_score, aria_total_interactions to players. |
Pending / out-of-band¶
- No pending migrations on disk (head matches the latest model state for the columns surveyed in this docs pass).
- The
services/gameserver/sql/directory carries hand-written bootstrap scripts (init-central-nexus.sql,init-region.sql,ai-companion-schema.sql,enhanced-ai-system-schema.sql) that are run outside Alembic for multi-region database provisioning and AI/companion side-tables. These are not tracked in the alembic revision graph. - Side-table models that exist in code but are not visibly covered by named migrations (likely created within the initial schema or supplemental SQL):
ARIAPersonalMemory,ARIAMarketIntelligence,ARIAExplorationMap,ARIATradingPattern,AIComprehensiveAssistant,PlayerTradingProfile,AIRecommendation,Translation,OAuthAccount,RefreshToken,MFASecret,MFAAttempt,PlayerCredentials. Verify against the initial migration before deploying to a fresh region.
How to extend¶
alembic revision --autogenerate -m "<short summary>"from the gameserver service.- Hand-edit the generated revision to remove noise and ensure ENUM/CHECK constraints round-trip correctly.
- Add a row to the table above and update the chain diagram if the new revision changes the head.