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.

23 lines
683 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 = [
  12. ('api', '0054_auto_20190112_1427'),
  13. ]
  14. operations = [
  15. migrations.RunPython(fill_project_id, migrations.RunPython.noop),
  16. ]