Don't deprovision within running Kolibri to create preseeded DBs #12184
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.
Summary
Background
In order to speed up initial startup of Kolibri, we bundle pre-migrated SQLite databases within the WHL file. We use the
deprovision
management command to create these database files, although we executed it through a script that is 'running' Kolibri.The issue
The prior approach created SQLite databases that retained data, such as Morango's Database ID model records, meaning it isn't randomly generated during startup as is desired.
What's changed
By running the management command directly, we instead produce databases that align with the intended result-- they do not have any data records but are pre-migrated. The existing process has turned into a bash script, which also verifies a few important database tables are empty.
References
https://learningequality.slack.com/archives/CB37UM23A/p1715957359298019
Reviewer guidance
make preseeddb
kolibri/dist/home/db.sqlite3
does not have any records inmorango_databaseidmodel
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)