PS: Add missing downgrade and upgrade scripts #203
Merged
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.
@chanel-y ran the first campaign across all Microsoft PowerShell code yesterday (🥳)
However, they all failed (😭) because of a broken upgrade-script chain.
A broken what?
We want to be able to analyze database produced by old extractors. This is hard because we may make changes to the way the database is structured (i.e., the schema outputted by the extractor) over time.
How we solve dbscheme mismatches
Every time we make changes to the database schema file (colloquially called "the dbscheme") we need to add a pair of upgrade and downgrade scripts which tells the QL engine:
(1) ensures that we can analyze old databases with new QL code, and (2) ensures that we can analyze new databases with old QL code. Arguably, the first one is the most important since old databases tend to stay in use for a long time.
GitHub has a document describing the process of creating up-and downgrade scripts here if you're curious about what these look like.
The current problem
For the few times I've modified the database scheme I've provided these scripts (see, for example, #88 and #100). However, it looks like this was missed at some point before I joined. So the current situation is that:
This PR adds that upgrade missing upgrade script. This completes the chain so that we can analyze databases with the X1 dbscheme using the current QL code (which assumes dbscheme Xn).