# Generated by Django 4.1.3 on 2022-12-05 13:45

import django.contrib.postgres.fields
import django.contrib.postgres.fields.citext
import django.contrib.postgres.fields.hstore
import django.contrib.postgres.fields.ranges
import django.db.models.deletion
from django.contrib.postgres.operations import (
    CITextExtension,
    HStoreExtension,
)
from django.db import (
    migrations,
    models,
)

import audoma.django.db.fields


class Migration(migrations.Migration):

    dependencies = [
        ("healthcare_api", "0001_initial"),
    ]

    operations = [
        HStoreExtension(),
        CITextExtension(),
        migrations.CreateModel(
            name="Prescription",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "drugs",
                    django.contrib.postgres.fields.ArrayField(
                        base_field=django.contrib.postgres.fields.hstore.HStoreField(),
                        size=None,
                    ),
                ),
                ("usable_in", django.contrib.postgres.fields.ranges.DateRangeField()),
                (
                    "issued_in",
                    django.contrib.postgres.fields.citext.CICharField(max_length=255),
                ),
                ("is_valid", audoma.django.db.fields.BooleanField(default=True)),
                (
                    "issued_by",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="healthcare_api.doctor",
                    ),
                ),
                (
                    "issued_for",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="healthcare_api.patient",
                    ),
                ),
            ],
        ),
    ]
