@@ -0,0 +1,874 @@
+from django.core.management.base import BaseCommand%0A%0Afrom TWLight.resources.models import Partner%0A%0A%0Aclass Command(BaseCommand):%0A    help = %22Migrates content from the tags column to the new_tags column%22%0A%0A    def handle(self, *args, **options):%0A        partners = Partner.objects.all()%0A%0A        for partner in partners:%0A            new_tags_dict = %7B%7D%0A            tag_names = %5B%5D%0A            tags = partner.tags.all()%0A            for tag in tags:%0A                if tag.name == %22sciences%22 or tag.name == %22social%22:%0A                    tag_name = %22social-sciences_tag%22%0A                else:%0A                    tag_name = %22%7Btag_name%7D_tag%22.format(tag_name=tag.name)%0A%0A                if tag_name not in tag_names:%0A                    tag_names.append(tag_name)%0A%0A            new_tags_dict%5B%22tags%22%5D = tag_names%0A%0A            partner.new_tags = new_tags_dict%0A%0A            partner.save()%0A

Add management command to migrate tags to new_tags field