-
Couldn't load subscription status.
- Fork 43
[wait until 0.5.1] Disable UpdateHistory for SV and Splitwell apps #2675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
OriolMunoz-da
wants to merge
13
commits into
main
Choose a base branch
from
oriol/non-optional-metrics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7b8dc43
Disable UpdateHistory for SV and Splitwell apps
OriolMunoz-da ad2b047
[ci] when has lazy not fixed a npe
OriolMunoz-da 3aefc00
[ci] remove register duplicates
OriolMunoz-da 695a66e
[ci] DbStorage errywhere
OriolMunoz-da c1a2fcf
[ci] Docs
OriolMunoz-da 2827e8b
Merge branch 'main' into oriol/non-optional-metrics
OriolMunoz-da 2ff977b
[ci] run pls gh
OriolMunoz-da 428dbac
Merge branch 'main' into oriol/non-optional-metrics
OriolMunoz-da 4a38d9f
[ci] truncate tables for sv app
OriolMunoz-da f1f167a
Merge branch 'main' into oriol/non-optional-metrics
OriolMunoz-da 2a99661
fix migration
OriolMunoz-da 3f938d6
[ci] chekc update history of externals
OriolMunoz-da 6163ffd
Make scanConfig mandatory in SV app (#2686)
OriolMunoz-da File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
26 changes: 26 additions & 0 deletions
26
...urces/db/migration/canton-network/postgres/stable/V048__truncate_sv_splitwell_history.sql
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| -- if the only 2 store descriptors belong to the SV app, that means we can truncate the update_history tables | ||
|
|
||
| DO $$ | ||
| DECLARE | ||
| descriptors TEXT[]; | ||
| BEGIN | ||
|
|
||
| -- array equality (ordered) ensures that exactly these two, no more, no less, are there <=> it's the SV app | ||
| select array_agg(store_name order by store_name) into descriptors | ||
| from update_history_descriptors; | ||
|
|
||
| IF (descriptors = '{"DbSvDsoStore", "DbSvSvStore"}' OR descriptors = '{"DbSplitwellStore"}') THEN | ||
| RAISE NOTICE 'Truncating update history tables as only SV/Splitwell app descriptors are present. Descriptors: %', descriptors::text; | ||
| EXECUTE 'TRUNCATE TABLE update_history_assignments CASCADE'; | ||
| EXECUTE 'TRUNCATE TABLE update_history_unassignments CASCADE'; | ||
| EXECUTE 'TRUNCATE TABLE update_history_backfilling CASCADE'; | ||
| EXECUTE 'TRUNCATE TABLE update_history_creates CASCADE'; | ||
| EXECUTE 'TRUNCATE TABLE update_history_exercises CASCADE'; | ||
| EXECUTE 'TRUNCATE TABLE update_history_transactions CASCADE'; | ||
| EXECUTE 'TRUNCATE TABLE update_history_last_ingested_offsets CASCADE'; | ||
| EXECUTE 'TRUNCATE TABLE update_history_descriptors CASCADE'; | ||
| ELSE | ||
| RAISE NOTICE 'This is not the SV or Splitwell app, NOT truncating update history tables. Descriptors: %', descriptors::text; | ||
| END IF; | ||
|
|
||
| END $$; | ||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: The
acs_snapshot_datatable has a foreign key constraint toupdate_history_creates. We don't need to truncateacs_snapshot_databecause the SV app doesn't write any data into it (and we'd rather fail if there is any unexpected data in there after all).