delete functions from 0045_migrate_tags
@@ -18,6 +18,8 @@ import taggit.managers
# TWLight.resources.migrations.0013_auto_20161207_1505
# TWLight.resources.migrations.0015_auto_20161208_1526
# TWLight.resources.migrations.0020_move_to_internal_durationfield
+
+# Functions from the following migrations need skipped
# TWLight.resources.migrations.0045_migrate_tags
@@ -60,37 +62,6 @@ def delete_access_grant_terms(apps, schema_editor):
partner.save()
-# Migrate the existing tag objects to the model that lives in resources.
-def copy_tags(apps, schema_editor):
- for old_tag in Tag.objects.all():
- new_tag = TextFieldTag()
- new_tag.name = old_tag.name
- new_tag.slug = old_tag.slug
- new_tag.save()
-
-
-# Opportunistically apply data from old tag field to the new tag field.
-def retag_partners(apps, schema_editor):
- # Wrapped in try because languages that have been added after this
- # migration will be a dependency of the Partner objects. This is a
- # One-shot data migration, so it's fine if we skip it forever once all
- # servers have run it at least once.
- try:
- for partner in Partner.objects.all():
- old_tags = partner.old_tags.all()
- for old_tag in old_tags:
- partner.tags.add(old_tag.name)
- partner.save()
- except:
- pass
-
-
-# Delete the old tag data
-def delete_old_tags(apps, schema_editor):
- for old_tag in Tag.objects.all():
- old_tag.delete()
-
-
class Migration(migrations.Migration):
replaces = [
@@ -1214,15 +1185,6 @@ class Migration(migrations.Migration):
verbose_name="Old Tags",
),
),
- migrations.RunPython(
- code=copy_tags,
- ),
- migrations.RunPython(
- code=retag_partners,
- ),
- migrations.RunPython(
- code=delete_old_tags,
- ),
migrations.AlterField(
model_name="language",
name="language",
