-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
populate release organizations and projects #4631
Conversation
qs = orm.Release.objects.all().select_related('project') | ||
for r in RangeQuerySetWrapperWithProgressBar(qs): | ||
r.organization_id = r.project.organization_id | ||
r.save() |
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.
Change this to:
orm.Release.objects.filter(id=r.id).update(organization_id=r.project.organization_id)
|
||
def backwards(self, orm): | ||
"Write your backwards methods here." | ||
for r in orm.Release.objects.all(): |
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.
tbh I'd just remove this. There's literally no rolling back ever.
ba9540c
to
d86c5af
Compare
292d67b
to
8cd7146
Compare
8cd7146
to
9591772
Compare
Generated by 🚫 danger |
use update in migration, remove backwards migration
9591772
to
74f15f9
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.
😎
relies on #4627 (will switch to merge into master once that pr has been merged)
cc @benvinegar @kjlundsgaard