-
Notifications
You must be signed in to change notification settings - Fork 429
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
fix(model/featurestate): make environment not null #2708
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Uffizzi Preview |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2708 +/- ##
========================================
Coverage 95.47% 95.48%
========================================
Files 986 988 +2
Lines 27709 27810 +101
========================================
+ Hits 26454 26553 +99
- Misses 1255 1257 +2
☔ View full report in Codecov by Sentry. |
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
|
||
def delete_feature_states_without_environment(apps, schema_editor): | ||
FeatureState = apps.get_model("features", "FeatureState") | ||
FeatureState.objects.filter(environment=None).delete() |
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.
I don't know if it makes a difference, but the correct way to do this I think is: filter(environment__isnull=True)
. I think it's perhaps because in different database engines, it handles null
differently.
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.
Yeah, done
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingChanges
Don't allow null value for environment field of feature state model.
Here is the sqlmigrate of the migration:
How did you test this code?
Adds migration test