-
Notifications
You must be signed in to change notification settings - Fork 30
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
875 remove obsolete data classes from db #921
Conversation
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
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.
Nicely done. I'd just request a small refactoring, and I found an unexpected alteration of the annotation table we'd need to look into.
flexmeasures/data/migrations/versions/ad98460751d9_remove_obsolete_tables.py
Outdated
Show resolved
Hide resolved
flexmeasures/data/migrations/versions/ad98460751d9_remove_obsolete_tables.py
Outdated
Show resolved
Hide resolved
flexmeasures/data/migrations/versions/ad98460751d9_remove_obsolete_tables.py
Outdated
Show resolved
Hide resolved
flexmeasures/data/migrations/versions/ad98460751d9_remove_obsolete_tables.py
Outdated
Show resolved
Hide resolved
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Tested with a new database and a database dump. It all worked properly. |
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.
Thanks, Guus!
Description
Remove obsolete tables from the DB if they are empty, otherwise give the user the choice to continue anyway.
Look & Feel
run
flexmeasures db upgrade
How to test
If all the tables that will be removed are empty there will not be asked for confirmation. To test the check you can add a table name that has data to the table list and run db upgrade.
Further Improvements
Potential improvements to be done in the same PR or follow up Issues/Discussions/PRs.
Related Items
Mention if this PR closes an Issue or Project.