# Generated by Django 3.0 on 2019-12-12 23:20

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("auth", "0011_update_proxy_permissions"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Laboratory",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "commet",
                    models.CharField(
                        blank=True,
                        max_length=64,
                        null=True,
                        verbose_name="注意事项",
                    ),
                ),
                (
                    "check_part",
                    models.CharField(max_length=64, verbose_name="检查部位"),
                ),
                (
                    "create_time",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="创建时间"
                    ),
                ),
                (
                    "creator",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="created_laboratories",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="创建者id",
                    ),
                ),
                (
                    "executor",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="executed_laboratories",
                        to="auth.Group",
                        verbose_name="执行科室id",
                    ),
                ),
                (
                    "patient",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="laboratories",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="病人id",
                    ),
                ),
            ],
            options={
                "verbose_name": "化验单",
                "verbose_name_plural": "化验单",
                "db_table": "laboratory",
            },
        ),
        migrations.CreateModel(
            name="LaboratoryType",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=256, verbose_name="类型名称")),
            ],
            options={
                "verbose_name": "化验类型",
                "verbose_name_plural": "化验类型",
                "db_table": "laboratory_type",
            },
        ),
        migrations.CreateModel(
            name="LaboratoryItem",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "modify_time",
                    models.DateTimeField(auto_now=True, verbose_name="修改时间"),
                ),
                (
                    "laboratory",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="items",
                        to="laboratory.Laboratory",
                        verbose_name="化验单id",
                    ),
                ),
                (
                    "laboratory_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="items",
                        to="laboratory.LaboratoryType",
                        verbose_name="化验类型id",
                    ),
                ),
                (
                    "modifier",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        related_name="modified_laboratory_items",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="修改者id",
                    ),
                ),
            ],
            options={
                "verbose_name": "化验单项目",
                "verbose_name_plural": "化验单项目",
                "db_table": "laboratory_item",
            },
        ),
    ]
