34199 Addition of delta restore script for tracking table dump#4568
Open
argush3 wants to merge 1 commit into
Open
34199 Addition of delta restore script for tracking table dump#4568argush3 wants to merge 1 commit into
argush3 wants to merge 1 commit into
Conversation
|
Rajandeep98
approved these changes
Jul 14, 2026
ketaki-deodhar
approved these changes
Jul 14, 2026
ketaki-deodhar
left a comment
Collaborator
There was a problem hiding this comment.
sonarqube shows 196 new issues. Not entirely sure if too critical to resolve but just noticed it.
Collaborator
Author
i'll see if i can knock some of these down |
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.



Issue #: /bcgov/entity#34199
What changed
Replaces the old, unsupported
DELTA_MODE=true ./restore_extract.shprototype with a proper,standalone
data-tool/delta_restore_extract.shthat can merge a preserved-table dump into adeveloper's existing local COLIN extract without truncating the local tracking/migration/auth
side-tables.
restore_extract.shnow aborts immediately ifDELTA_MODE=trueis passed, with a pointer to thenew script.
Key additions
data-tool/delta_restore_extract.shdata-tool/scripts/restore/delta/10_functions.sqldata-tool/scripts/restore/preserved_tables.confdata-tool/scripts/restore/repair_sequences.sqldata-tool/scripts/restore/README_delta_restore.mddata-tool/tests/delta_restore/data-tool/Makefilemake test-delta-restoretargetModified:
backup_extract_tables.sh— readspreserved_tables.conf(was hardcoded)restore_extract.sh— deadDELTA_MODEbranch removed; now errors cleanlyscripts/colin_corps_extract_postgres_ddl— minor column additions for tracking tablesRow classification (reviewer orientation)
Preview mode classifies every staged row before anything is written:
NEWCHANGEDCHANGED_LOCAL_NEWERlast_modifiedis newerUNCHANGEDBLOCKED_FK/BLOCKED_PARENT/AMBIGUOUS_NKHappy path — preview → apply
scripts/generated/delta_restore/<run>/preview.txt(truncated):selection.conf(edit before applying — e.g. exclude a table or opt-inchanged_local_newer):apply_summary.txt:# Cleanup delta schemas if a run was interrupted PGDATABASE=local_extract ./delta_restore_extract.sh --cleanupRun tests
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).