# Generated by Django 2.2.11 on 2020-03-27 06:19

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




class Migration(migrations.Migration):

    dependencies = [
        ('users', '0013_auto_20200327_0437'),
        ('facility', '0029_auto_20200326_1706'),
    ]

    operations = [
        migrations.RenameField(
            model_name='ambulance',
            old_name='new_primary_district',
            new_name='primary_district_obj',
        ),
        migrations.RenameField(
            model_name='ambulance',
            old_name='new_secondary_district',
            new_name='secondary_district_obj',
        ),
        migrations.RenameField(
            model_name='ambulance',
            old_name='new_third_district',
            new_name='third_district_obj',
        ),
        migrations.RemoveField(
            model_name='facility',
            name='local_body',
        ),
        migrations.RemoveField(
            model_name='facility',
            name='new_district',
        ),
        migrations.AlterField(
            model_name='ambulance',
            name='primary_district',
            field=models.IntegerField(choices=[(1, 'Thiruvananthapuram'), (2, 'Kollam'), (3, 'Pathanamthitta'), (4, 'Alappuzha'), (5, 'Kottayam'), (6, 'Idukki'), (7, 'Ernakulam'), (8, 'Thrissur'), (9, 'Palakkad'), (10, 'Malappuram'), (11, 'Kozhikode'), (12, 'Wayanad'), (13, 'Kannur'), (14, 'Kasargode')]),
        ),
        migrations.AlterField(
            model_name='ambulance',
            name='secondary_district',
            field=models.IntegerField(blank=True, choices=[(1, 'Thiruvananthapuram'), (2, 'Kollam'), (3, 'Pathanamthitta'), (4, 'Alappuzha'), (5, 'Kottayam'), (6, 'Idukki'), (7, 'Ernakulam'), (8, 'Thrissur'), (9, 'Palakkad'), (10, 'Malappuram'), (11, 'Kozhikode'), (12, 'Wayanad'), (13, 'Kannur'), (14, 'Kasargode')], null=True),
        ),
        migrations.AlterField(
            model_name='ambulance',
            name='third_district',
            field=models.IntegerField(blank=True, choices=[(1, 'Thiruvananthapuram'), (2, 'Kollam'), (3, 'Pathanamthitta'), (4, 'Alappuzha'), (5, 'Kottayam'), (6, 'Idukki'), (7, 'Ernakulam'), (8, 'Thrissur'), (9, 'Palakkad'), (10, 'Malappuram'), (11, 'Kozhikode'), (12, 'Wayanad'), (13, 'Kannur'), (14, 'Kasargode')], null=True),
        ),
        migrations.AlterField(
            model_name='facility',
            name='district',
            field=models.IntegerField(choices=[(1, 'Thiruvananthapuram'), (2, 'Kollam'), (3, 'Pathanamthitta'), (4, 'Alappuzha'), (5, 'Kottayam'), (6, 'Idukki'), (7, 'Ernakulam'), (8, 'Thrissur'), (9, 'Palakkad'), (10, 'Malappuram'), (11, 'Kozhikode'), (12, 'Wayanad'), (13, 'Kannur'), (14, 'Kasargode')]),
        ),
        migrations.CreateModel(
            name='FacilityLocalGovtBody',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('district', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='users.District')),
                ('facility', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='facility.Facility')),
                ('local_body', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='users.LocalBody')),
            ],
        ),
        migrations.AddConstraint(
            model_name='facilitylocalgovtbody',
            constraint=models.CheckConstraint(check=models.Q(('local_body__isnull', False), ('district__isnull', False), _connector='OR'), name='cons_facilitylocalgovtbody_only_one_null'),
        ),
    ]
