You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
653 B

  1. # Generated by Django 2.1.5 on 2019-01-12 14:27
  2. from django.db import migrations
  3. def fill_project_id(apps, schema_editor):
  4. Project = apps.get_model("accounts", "Project")
  5. Check = apps.get_model("api", "Check")
  6. Channel = apps.get_model("api", "Channel")
  7. for project in Project.objects.all():
  8. Check.objects.filter(user_id=project.owner_id).update(project=project)
  9. Channel.objects.filter(user_id=project.owner_id).update(project=project)
  10. class Migration(migrations.Migration):
  11. dependencies = [("api", "0054_auto_20190112_1427")]
  12. operations = [migrations.RunPython(fill_project_id, migrations.RunPython.noop)]