# Generated by Django 1.11.15 on 2019-04-01 23:58

from django.db import migrations


def migrate_to_central_tendency(apps, schema_editor):
    Exposure = apps.get_model("epi", "Exposure")
    CentralTendency = apps.get_model("epi", "CentralTendency")
    for exposure in Exposure.objects.all():
        CentralTendency.objects.create(
            exposure_id=exposure.id,
            estimate=exposure.estimate,
            estimate_type=exposure.estimate_type,
            variance=exposure.variance,
            variance_type=exposure.variance_type,
            lower_ci=exposure.lower_ci,
            upper_ci=exposure.upper_ci,
            lower_range=exposure.lower_range,
            upper_range=exposure.upper_range,
            description=exposure.description,
        )


class Migration(migrations.Migration):
    dependencies = [
        ("epi", "0012_create_central_tendency"),
    ]

    operations = [
        migrations.RunPython(migrate_to_central_tendency),
    ]
