-
Notifications
You must be signed in to change notification settings - Fork 11
Updates migration with alembic #385
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
Creylay
wants to merge
75
commits into
develop
Choose a base branch
from
feature/redo-db-migrations
base: develop
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
Conversation
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 way they are packaged and installed properly with the package installation. Also modify MANIFEST.in to include the alembic files in the sdist package. Deletes all current migrations as they will be recreated from scratch after this change.
Now we use importlib resources to get the correct path to the alembic folder, which should work in any environment (and also when packaged).
This checks that there is no database drift between models file and migrations
Alembic config is load programatically, directly read from migrate.py instead of alembic.ini
Adds prediction table
… types in PrepareDatasetStep
…ary size prop from Chip component
…tion functionality
…s and data handling
…lidation data during optimization trials
…ted values in regression metrics
…odel inheritance and adding prepare_output method
…_dim in save/load methods
…ics for better clarity
…istance, Log Loss, and RoC AUC
…e, and Median Absolute Error
…sted metrics data
…ort log_index for better metric tracking
…cs in DistilBERT and OpusMT models
…etric logging and batch size handling
…e and improve user selection handling
…ic data structure
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.
Summary
This PR redo the migrations configuration that were first applied here: #303 and reverted here: #329
This PR (re)introduce database migration using alembic (automatic migrations). The main objective is to be able to update the database without deleting the current one. Migrations scripts are generated using alembic at dev command and are applied automatically at app startup.
Two main features of this PR is that migrations are applied automatically on app startup and adds CI configuration to check database consistency between models and migrations scripts (to ensure there is no db drift).
Note (previous bug of #303)
It was reported that migrations weren't being applied in the packaged version of DashAI. i.e: after installing it with
pip install .. This was caused because alembic configuration wasn't packaged and couldn't be load properly. This is fixed in this PR.Type of Change
Check all that apply like this [x]:
Changes (by file)
DashAI/alembicMANIFEST.into package alembic files.DashAI/back/app.pyTesting (optional)
No tests added in
testing/but a new CI configuration is added to check drift between migrations and models.Tested running with:
And after
And migrations were applied correctly on startup.