# Generated by Django 3.0.5 on 2020-04-22 20:43

from django.db import migrations


def update_task_name(apps, schema_editor):
    PeriodicTask = apps.get_model("django_celery_beat", "PeriodicTask")

    old_task = "newsreader.news.collection.tasks.collect"
    new_task = "newsreader.news.collection.tasks.FeedTask"

    for task in PeriodicTask.objects.filter(task=old_task):
        task.task = new_task
        task.save()


class Migration(migrations.Migration):
    dependencies = [("accounts", "0007_auto_20191116_1255")]

    operations = [migrations.RunPython(update_task_name)]
