-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
migrations(insights): backfill user starred transactions from team starred transactions #93327
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
migrations(insights): backfill user starred transactions from team starred transactions #93327
Conversation
This PR has a migration; here is the generated SQL for for --
-- Raw Python operation
--
-- THIS OPERATION CANNOT BE WRITTEN AS SQL |
Codecov ReportAttention: Patch coverage is ✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #93327 +/- ##
===========================================
+ Coverage 45.48% 88.00% +42.52%
===========================================
Files 10242 10301 +59
Lines 591046 594252 +3206
Branches 23000 23000
===========================================
+ Hits 268812 522963 +254151
+ Misses 321743 70798 -250945
Partials 491 491 |
@markstory @wedamija Thanks a lot for all the comments! I made all the changes, if you could have another look that would be awesome |
user_ids = OrganizationMemberTeam.objects.filter(team=projectTeam.team).values_list( | ||
"organizationmember__user_id", flat=True | ||
) |
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.
You could use team_id=projectTeam.team_id
here which would let you skip loading the Team record as well. But what you have will work fine. There isn't enough data in TeamKeyTransaction to make an meaningful difference in runtime.
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.
👍
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.
👍
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
…arred transactions (#93327) Migrate team based transactions (teamkeytransaction) to user based transactions (insightsStarredSegments)
…arred transactions (#93327) Migrate team based transactions (teamkeytransaction) to user based transactions (insightsStarredSegments)
Migrate team based transactions (teamkeytransaction) to user based transactions (insightsStarredSegments)