Skip to content

feat(database): add share-code army families - #24

Merged
MagicTheDev merged 1 commit into
mainfrom
feat/army-family-schema-v2
Sep 10, 2026
Merged

MagicTheDev merged 1 commit into
mainfrom
feat/army-family-schema-v2

Conversation

@MagicTheDev

Copy link
Copy Markdown
Member

Battle ingestion and family analytics currently require SHA-256 composition rows, while the approved pipeline identifies exact armies by canonical share code and stores only requested-player observations.

This adds a staged schema transition after migration 013:

  • 014 makes ranked loot nullable without changing rows
  • a dry-run-by-default companion clears existing defense loot in bounded batches while writers are paused
  • 015 switches family/member primary identity to family ID and share code, retains nullable legacy columns for cutover, makes raw hashes optional, and adds parallel shifted-day v2 aggregates without deleting old history

The migration preserves existing representatives, names, assignments, old daily aggregates, attacks, and raw history. New code-only inserts do not calculate hashes or create composition rows.

Rollout is intentionally gated: apply 014, pause the old writer, complete the cleanup at Goose 14, apply 015, deploy compatible binaries, then resume ingestion. No production migration or cleanup was run.

Validation:

  • env GOCACHE=/tmp/clashking-army-schema-go-cache go test ./...
  • node --test scripts/with-test-timescale.test.mjs scripts/with-test-integration.test.mjs
  • fresh disposable Goose 001-015 plus all database tests
  • populated disposable 013 -> 014 -> cleanup -> 015 upgrade and rollback checks
  • git diff --check

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@MagicTheDev
MagicTheDev merged commit f7d07fe into main Sep 10, 2026
2 checks passed
@MagicTheDev
MagicTheDev deleted the feat/army-family-schema-v2 branch September 10, 2026 02:19
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.

1 participant