Skip to content

Commit

Permalink
https://github.com/gitcoinco/web/issues/5584
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Dec 31, 2019
1 parent 3ce913a commit 9c25720
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions scripts/debug/migrate_grant.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#migrates the info on one grant to another

old_grant_id = 128
new_grant_id = 200

from grants.models import Grant

old_grant = Grant.objects.get(pk=old_grant_id)
new_grant = Grant.objects.get(pk=new_grant_id)

for sub in old_grant.subscriptions.all():
sub.grant = new_grant
sub.save()

for obj in old_grant.phantom_funding.all():
obj.grant = new_grant
obj.save()

for obj in old_grant.milestones.all():
obj.grant = new_grant
obj.save()

for obj in old_grant.activities.all():
obj.grant = new_grant
obj.save()

for obj in old_grant.updates.all():
obj.grant = new_grant
obj.save()

# do not transfer CLR match over

old_grant.save()
new_grant.hidden = True
new_grant.save()

0 comments on commit 9c25720

Please sign in to comment.