Skip to content
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

Merged
merged 8 commits into from
Dec 18, 2023

Conversation

GustaafL
Copy link
Contributor

@GustaafL GustaafL commented Dec 8, 2023

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.


  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

GustaafL added 5 commits November 30, 2023 14:30
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>
@GustaafL GustaafL marked this pull request as ready for review December 8, 2023 11:25
@GustaafL GustaafL requested a review from Flix6x December 8, 2023 11:30
@Flix6x Flix6x linked an issue Dec 8, 2023 that may be closed by this pull request
Copy link
Contributor

@Flix6x Flix6x left a 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.

GustaafL added 2 commits December 13, 2023 14:01
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
Signed-off-by: GustaafL <guus@seita.nl>
@GustaafL
Copy link
Contributor Author

Tested with a new database and a database dump. It all worked properly.

Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Guus!

@Flix6x Flix6x added this to the 0.18.0 milestone Dec 18, 2023
@Flix6x Flix6x merged commit c7a61e6 into main Dec 18, 2023
7 of 9 checks passed
@Flix6x Flix6x deleted the 875-remove-obsolete-data-classes-from-db branch December 18, 2023 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data migration after removing obsolete data classes
2 participants