Skip to content

FMG full-JSON ingest maps regiment naval flag into total_men (r.n vs r.a) #39

Description

@barrulus

Symptom

Regiments layer badges show 0/1 for every regiment; FMG's own overview shows totals like 1886/1875. Digia: all 81 regiments have total_men in {0,1}.

Root cause

server/services/maps/fmg-full-json/ingesters/regiments.js (insert params, line ~26):

r.n ?? null, r.a ?? null,   // → (total_men, attack_value)

In FMG's military schema n is the naval flag (0/1) and a is the army total. So total_men gets the flag and attack_value gets the real total.

Fix

  • Ingester: total_men = r.a; attack_value has no FMG source — write NULL (or drop the column).
  • Backfill for already-imported worlds:
UPDATE maps_regiments SET total_men = attack_value::integer, attack_value = NULL
 WHERE attack_value IS NOT NULL;
  • components/layers/regiments.ts reads total_men for its badge — no frontend change needed once data is right.

Found browser-testing lazy-world-tiles 2026-08-10 (world Digia); pre-existing Plan B ingest bug, unrelated to that branch.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions