fix(model/featurestate): make environment not null#2708
Merged
gagantrivedi merged 3 commits intomainfrom Sep 5, 2023
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
|
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. |
matthewelwell
requested changes
Sep 4, 2023
|
|
||
| def delete_feature_states_without_environment(apps, schema_editor): | ||
| FeatureState = apps.get_model("features", "FeatureState") | ||
| FeatureState.objects.filter(environment=None).delete() |
Contributor
There was a problem hiding this comment.
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.
matthewelwell
approved these changes
Sep 4, 2023
2 tasks
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
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.
Thanks for submitting a PR! Please check the boxes below:
pre-committo 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