Skip to content

feat: add DB-first map persistence - #374

Open
suixincc wants to merge 4 commits into
Bitcoindefi:mainfrom
suixincc:codex/map-persistence-2
Open

suixincc wants to merge 4 commits into
Bitcoindefi:mainfrom
suixincc:codex/map-persistence-2

Conversation

@suixincc

Copy link
Copy Markdown

Map edit persistence with DB-first hydration

Resolves #3.

What it does

  • Adds a game_maps canonical JSONB row per map, with checksum/version metadata.
  • Extends game_data_revisions with the maps kind.
  • Adds an idempotent importer for all 294 mapas_source maps:
    pnpm --dir api import-game-maps.
  • The importer fills missing map ids without overwriting maps that were edited after import.
  • Adds internal map read/change endpoints and an admin canonical map update endpoint.
  • Every map insert/edit records a game_data_revisions row with the same checksum.
  • Server startup hydrates DB-published canonical maps over file maps, then applies the existing sparse tile/entity overrides.
  • Unimported maps continue to load from mapas_source, so partial migrations are safe.

Testing

  • API tsc --noEmit
  • Server tsc --noEmit
  • Server eslint
  • Server focused tests: 5 passed

The new API integration tests cover:

  • all 294 maps are available after import;
  • a second import does not add revisions;
  • edited maps are read from DB with a checksum;
  • each edit creates one revision;
  • unchanged edits do not create another revision.

@gitar-bot

gitar-bot Bot commented Sep 16, 2026

Copy link
Copy Markdown

Gitar is working

Gitar

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Etapa 0: capa de persistencia de ediciones de mapa

1 participant