# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-07-27 15:39
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('patients', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name='projectcurator',
            name='curator',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_projects', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='projectcurator',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_curators', to='patients.Project'),
        ),
        migrations.AddField(
            model_name='projectcrftemplate',
            name='crf_template',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_crf_template', to='patients.CRFTemplate'),
        ),
        migrations.AddField(
            model_name='projectcrftemplate',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_crf_templates', to='patients.Project'),
        ),
        migrations.AddField(
            model_name='projectcohort',
            name='cohort',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='related_cohort', to='patients.Cohort'),
        ),
        migrations.AddField(
            model_name='projectcohort',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='project_cohorts', to='patients.Project'),
        ),
        migrations.AddField(
            model_name='patientchartreviewquestion',
            name='crf_template_question',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='question_responses', to='patients.CRFTemplateQuestion'),
        ),
        migrations.AddField(
            model_name='patientchartreviewquestion',
            name='patient_chart_review',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions_data', to='patients.PatientChartReview'),
        ),
        migrations.AddField(
            model_name='patientchartreview',
            name='cohort',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='patient_cohort', to='patients.Cohort'),
        ),
        migrations.AddField(
            model_name='patientchartreview',
            name='crf_template',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='patient_crf_template', to='patients.CRFTemplate'),
        ),
        migrations.AddField(
            model_name='patientchartreview',
            name='curator',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='curators_patient', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='patientchartreview',
            name='patient',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='patient_chart_review', to='patients.Patient'),
        ),
        migrations.AddField(
            model_name='patientchartreview',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='patient_project', to='patients.Project'),
        ),
        migrations.AddField(
            model_name='patient',
            name='cohort',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='patients', to='patients.Cohort'),
        ),
        migrations.AddField(
            model_name='crftemplatequestion',
            name='crf_template',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions', to='patients.CRFTemplate'),
        ),
        migrations.AlterUniqueTogether(
            name='projectcurator',
            unique_together=set([('project', 'curator')]),
        ),
        migrations.AlterUniqueTogether(
            name='projectcrftemplate',
            unique_together=set([('project', 'crf_template')]),
        ),
        migrations.AlterUniqueTogether(
            name='projectcohort',
            unique_together=set([('cohort', 'project')]),
        ),
        migrations.AlterUniqueTogether(
            name='patientchartreview',
            unique_together=set([('project', 'cohort', 'crf_template', 'patient')]),
        ),
        migrations.AlterUniqueTogether(
            name='patient',
            unique_together=set([('cohort', 'patient_id')]),
        ),
        migrations.AlterUniqueTogether(
            name='crftemplatequestion',
            unique_together=set([('crf_template', 'text'), ('crf_template', 'question_id')]),
        ),
    ]
