# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2021-02-11 16:09
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Department',
            fields=[
                ('name', models.CharField(max_length=30, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Examination',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('results', models.CharField(choices=[(b'Healthy', b'Healthy'), (b'Corona', b'Corona'), (b'Dead', b'Dead'), (b'Botism', b'Botism')], max_length=20)),
                ('time', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Hospital',
            fields=[
                ('city', models.CharField(db_index=True, max_length=30)),
                ('name', models.CharField(max_length=30, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='patients', to='covid_examinations.Department')),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('age', models.PositiveSmallIntegerField()),
                ('name', models.CharField(db_index=True, max_length=30)),
                ('gender', models.CharField(choices=[(b'Male', b'Male'), (b'Other', b'Other'), (b'Female', b'Female')], max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='HospitalWorker',
            fields=[
                ('job', models.CharField(choices=[(b'Nurse', b'Nurse'), (b'Doctor', b'Doctor')], max_length=20)),
                ('personal_information', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='hospital_position', serialize=False, to='covid_examinations.Person')),
            ],
        ),
        migrations.AddField(
            model_name='patient',
            name='personal_information',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='patients', to='covid_examinations.Person'),
        ),
        migrations.AddField(
            model_name='examination',
            name='patient',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='examinations_history', to='covid_examinations.Patient'),
        ),
        migrations.AddField(
            model_name='department',
            name='hospital',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='departments', to='covid_examinations.Hospital'),
        ),
        migrations.AddField(
            model_name='hospitalworker',
            name='department',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='workers', to='covid_examinations.Department'),
        ),
        migrations.AddField(
            model_name='examination',
            name='worker',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='performed_examinations', to='covid_examinations.HospitalWorker'),
        ),
    ]
