Repository navigation
feat(ops): cleanup-draft-orphans.cjs — sweep orphaned draft rows (#2909/#2993) - #2994
Merged
Merged
Conversation
…2909 (#2993) Repeatable HANA cleanup for draft rows orphaned by draft_admin_integrity running without cascade constraints. Discovers real ADMINSERVICE_*_DRAFTS tables from SYS.TABLE_COLUMNS, deletes rows whose DraftAdministrativeData parent is gone, preserves live drafts, verifies clean after commit. --dry-run (default) / --commit. HANA-only. Idempotent. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
scripts/cleanup-draft-orphans.cjs, a repeatable HANA cleanup for draft rows orphaned by thedraft_admin_integrityoutage (#2909).Why
With the flag on and no cascade constraints, discarding/activating a draft deleted the
DRAFT_DRAFTADMINISTRATIVEDATAparent but left child rows inADMINSERVICE_*_DRAFTS→ orphans that make the active entity un-editable. #2992 stops new orphans; this clears ones already created (notably the gap between the outage and the fixed build reaching PROD).What it does
ADMINSERVICE_*_DRAFTStables fromSYS.TABLE_COLUMNS(no hardcoded list).DRAFTADMINISTRATIVEDATA_DRAFTUUIDhas no matchingDRAFT_DRAFTADMINISTRATIVEDATArow. Live drafts are never touched.--commit; exits 2 on unexpected state.--dry-run(default) /--commit; HANA-only; idempotent.Usage
Validated by hand on PROD during the 2026-11-02 incident (cleared 57 rows; 0 remaining; 11 live drafts preserved). Related: #2909, #2992, #2993.
🤖 Generated with Claude Code