# Generated by Django 2.2.5 on 2019-10-03 10:37

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


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0004_auto_20191003_1327'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('patientrecords', '0005_auto_20191002_1542'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='diagnosis',
            name='username',
        ),
        migrations.AddField(
            model_name='diagnosis',
            name='username',
            field=models.ManyToManyField(related_name='diagnosis_username', to='core.Patient'),
        ),
        migrations.AlterField(
            model_name='diagnosisperm',
            name='diag_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='diagnosisperm_diag', to='patientrecords.Diagnosis'),
        ),
        migrations.AlterField(
            model_name='diagnosisperm',
            name='given_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='diagnosisperm_given_by', to=settings.AUTH_USER_MODEL),
        ),
        migrations.RemoveField(
            model_name='diagnosisperm',
            name='username',
        ),
        migrations.AddField(
            model_name='diagnosisperm',
            name='username',
            field=models.ManyToManyField(related_name='diagnosisperm_usernames', to='core.Healthcare'),
        ),
        migrations.AlterField(
            model_name='documents',
            name='owner_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='documents_owner', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='documents',
            name='patient_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents_patient', to='core.Patient'),
        ),
        migrations.AlterField(
            model_name='documentsperm',
            name='docs_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documentsperm_documents', to='patientrecords.Documents'),
        ),
        migrations.AlterField(
            model_name='documentsperm',
            name='given_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='documentsperm_given_by', to=settings.AUTH_USER_MODEL),
        ),
        migrations.RemoveField(
            model_name='documentsperm',
            name='username',
        ),
        migrations.AddField(
            model_name='documentsperm',
            name='username',
            field=models.ManyToManyField(related_name='documentsperm_usernames', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='images',
            name='owner_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='images_owner', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='images',
            name='patient_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images_patient', to='core.Patient'),
        ),
        migrations.AlterField(
            model_name='imagesperm',
            name='given_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='imagessperm_given_by', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='imagesperm',
            name='img_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='imagesperm_images', to='patientrecords.Images'),
        ),
        migrations.RemoveField(
            model_name='imagesperm',
            name='username',
        ),
        migrations.AddField(
            model_name='imagesperm',
            name='username',
            field=models.ManyToManyField(related_name='imagesperm_usernames', to='core.Healthcare'),
        ),
        migrations.AlterField(
            model_name='readings',
            name='owner_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='readings_owner', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='readings',
            name='patient_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='readings_patient', to='core.Patient'),
        ),
        migrations.AlterField(
            model_name='readingsperm',
            name='given_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='readingsperm_given_by', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='readingsperm',
            name='readings_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='readingsperm_reading', to='patientrecords.Readings'),
        ),
        migrations.RemoveField(
            model_name='readingsperm',
            name='username',
        ),
        migrations.AddField(
            model_name='readingsperm',
            name='username',
            field=models.ManyToManyField(related_name='readingsperm_usernames', to='core.Healthcare'),
        ),
        migrations.AlterField(
            model_name='timeseries',
            name='owner_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='timeseries_owner', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='timeseries',
            name='patient_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='timeseries_patient', to='core.Patient'),
        ),
        migrations.AlterField(
            model_name='timeseriesperm',
            name='given_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='timeseriesperm_given_by', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='timeseriesperm',
            name='timeseries_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='timeseriesperm_timeseries', to='patientrecords.TimeSeries'),
        ),
        migrations.RemoveField(
            model_name='timeseriesperm',
            name='username',
        ),
        migrations.AddField(
            model_name='timeseriesperm',
            name='username',
            field=models.ManyToManyField(related_name='timeseriesperm_usernames', to='core.Healthcare'),
        ),
        migrations.AlterField(
            model_name='videos',
            name='owner_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='videos_owner', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='videos',
            name='patient_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='videos_patient', to='core.Patient'),
        ),
        migrations.AlterField(
            model_name='videosperm',
            name='given_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='videosperm_given_by', to=settings.AUTH_USER_MODEL),
        ),
        migrations.RemoveField(
            model_name='videosperm',
            name='username',
        ),
        migrations.AddField(
            model_name='videosperm',
            name='username',
            field=models.ManyToManyField(related_name='videosperm_usernames', to='core.Healthcare'),
        ),
        migrations.AlterField(
            model_name='videosperm',
            name='videos_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='videosperm_videos', to='patientrecords.Videos'),
        ),
    ]
