Skip to content

docs(provincesystem): retire the SQLite rollback and rename entitlement tables - #295

Merged
ryanbarlow97 merged 4 commits into
mainfrom
ps-db-cleanup-1
Oct 17, 2026
Merged

ryanbarlow97 merged 4 commits into
mainfrom
ps-db-cleanup-1

Conversation

@ryanbarlow97

@ryanbarlow97 ryanbarlow97 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Companion to TF-Minecraft/TFMCWeb#267.

  • Deploys (DEPLOY.md, ops/postgresql.md): both sites run on PostgreSQL. site-deploy refuses revisions from before the move, always runs prepare (migrates the database the authority marker names) then studio, also when it returns to the last healthy revision, and keeps only PostgreSQL dumps (newest 10). The copy tool, legacy_sqlite.sql, reverse export and the 30-day retention guidance are gone; old province.db files are plain backups. Migrations only go forward: before changing anything, site-deploy compares schema_migrations with the target revision's migration files and refuses a revision missing one (exit 4, <sha> predates database migration NNNN; fix forward). After a failed deploy it checks the last healthy revision the same way; if the database is newer, the backend stays stopped (failed: database is newer than the last healthy revision; backend kept stopped). prepare repeats the check. Previews of branches cut before a new Dev migration fail until rebased.
  • Previews: clones list Dev's public tables minus precedent_*, patchnote_* and schema_migrations. Readiness text now reflects that NATIVE_POSTGRES_PREVIEWS_READY is on.
  • Tables: rpc_player_meta → web_entitlements (skin_kinds, permission_flags); character_player_meta → character_account_meta (18+, account creation time, kit cooldowns). The character limit, name colours and wardrobe slots come only from web_entitlements; unsynced players get the catalogue default limit. Updated in architecture, creator, tfmcweb, auth-security, title-editor, skins, drinks and RPCharacters realm-wipe. Removed the stale drink_player_meta line and the deprecated /skins|/drinks/plugin/player-meta mentions (those routes no longer exist).
  • Code plaintext (auth-security, ops/postgresql.md): cleared on redeem, submission use and revoke, and hourly for expired codes.
  • Smoke script: backend/scripts/web_entitlements_smoke.py.

Host steps: root installs ProvinceSystem#267's scripts/site-deploy.sh on the host before #267 merges, so the deploy that first applies 0002 is protected; scripts/ps-preview.sh can follow after merge (DEPLOY.md, host scripts).

Checks: python -m unittest discover -s scripts -p 'test_*.py' and python scripts/check-indexes.py pass.

🤖 Generated with Claude Code

ryanbarlow97 and others added 2 commits October 17, 2026 12:33
…nt tables

Both sites run on PostgreSQL. Deploys always run prepare and studio,
refuse revisions from before the move and keep only PostgreSQL dumps.
Preview clones list Dev's tables from its schema. rpc_player_meta is now
web_entitlements and character_player_meta is now character_account_meta.
Login codes drop their plaintext once spent, revoked or expired.

Companion to TF-Minecraft/TFMCWeb#267.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
prepare refuses a revision that lacks a migration the database already
has, so an older-commit deploy is refused after a newer migration and a
failed deploy that migrated keeps the backend stopped. Previews of
branches cut before a new Dev migration need a rebase.

Companion to TF-Minecraft/TFMCWeb#267 (d839fc24).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ryanbarlow97 and others added 2 commits October 17, 2026 12:57
site-deploy compares schema_migrations with the target revision's
migration files and refuses a revision missing one (exit 4). After a
failed deploy it checks the last healthy revision the same way and keeps
the backend stopped if the database is newer.

Companion to TF-Minecraft/TFMCWeb#267 (aa54b7b3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ryanbarlow97
ryanbarlow97 merged commit b130008 into main Oct 17, 2026
1 check passed
@ryanbarlow97
ryanbarlow97 deleted the ps-db-cleanup-1 branch October 17, 2026 13:26
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