-
Notifications
You must be signed in to change notification settings - Fork 2
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
Disregard migrations older than the schema #81
Conversation
I think we should disregard migrations older than the schemas in all cases. The schemas should represent what the older migrations would have output. |
Codecov Report
@@ Coverage Diff @@
## master #81 +/- ##
==========================================
- Coverage 79.17% 78.62% -0.55%
==========================================
Files 15 15
Lines 629 641 +12
Branches 79 81 +2
==========================================
+ Hits 498 504 +6
- Misses 122 127 +5
- Partials 9 10 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
I fully agree with @nadege :) |
d863afc
to
055927b
Compare
Ah, that's a good thing that I had gone ahead and implemented @nadege 's suggestion, then :) It's ready to review ! |
055927b
to
0c9a14f
Compare
septentrion/core.py
Outdated
@@ -128,7 +128,9 @@ def get_fixtures_version( | |||
return version | |||
|
|||
|
|||
def build_migration_plan(settings: configuration.Settings) -> Iterable[Dict[str, Any]]: | |||
def build_migration_plan( | |||
settings: configuration.Settings, schema_version: Optional[versions.Version] = None |
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.
why is the schema_version
parameter optional ?
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.
At first I thought it was the case, but it later turned out not to be. I'll remove the default at None too, event if it means I have to fix a few tests.
0c9a14f
to
60a6fe6
Compare
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.
🎉
LGTM
Cf. #32
With this PR, migrations older than the schema are not considered. If no schema is explicitely configured (even if one is used, because the latest schema is automatically used), then all migrations are considered.
Is it the right thing to do, or should I disregard all migrations older than the schema event when schema is not explicitely provided ?
Missing tests (& doc but the Septentrion doc is... Not ready)
Successful PR Checklist: