# Generated by Django 5.2 on 2024-11-15 14:08

import bionty.ids
import django.db.models.deletion
import lamindb.base.fields
import lamindb.base.ids
import lamindb.base.users
import lamindb.models
from django.db import migrations


class Migration(migrations.Migration):
    dependencies = [
        ("bionty", "0041_alter_artifactcellline_artifact_and_more"),
        ("clinicore", "0006_artifactbiosample_artifactclinicaltrial_and_more"),
    ]

    operations = [
        migrations.AlterField(
            model_name="artifactbiosample",
            name="artifact",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="links_biosample",
                to="lamindb.artifact",
            ),
        ),
        migrations.AlterField(
            model_name="artifactbiosample",
            name="biosample",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifact",
                to="clinicore.biosample",
            ),
        ),
        migrations.AlterField(
            model_name="artifactbiosample",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="artifactbiosample",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="artifactbiosample",
            name="feature",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifactbiosample",
                to="lamindb.feature",
            ),
        ),
        migrations.AlterField(
            model_name="artifactbiosample",
            name="feature_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifactbiosample",
            name="label_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifactbiosample",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="artifactclinicaltrial",
            name="artifact",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="links_clinical_trial",
                to="lamindb.artifact",
            ),
        ),
        migrations.AlterField(
            model_name="artifactclinicaltrial",
            name="clinicaltrial",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifact",
                to="clinicore.clinicaltrial",
            ),
        ),
        migrations.AlterField(
            model_name="artifactclinicaltrial",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="artifactclinicaltrial",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="artifactclinicaltrial",
            name="feature",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifactclinicaltrial",
                to="lamindb.feature",
            ),
        ),
        migrations.AlterField(
            model_name="artifactclinicaltrial",
            name="feature_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifactclinicaltrial",
            name="label_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifactclinicaltrial",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="artifactmedication",
            name="artifact",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="links_medication",
                to="lamindb.artifact",
            ),
        ),
        migrations.AlterField(
            model_name="artifactmedication",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="artifactmedication",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="artifactmedication",
            name="feature",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifactmedication",
                to="lamindb.feature",
            ),
        ),
        migrations.AlterField(
            model_name="artifactmedication",
            name="feature_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifactmedication",
            name="label_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifactmedication",
            name="medication",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifact",
                to="clinicore.medication",
            ),
        ),
        migrations.AlterField(
            model_name="artifactmedication",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="artifactpatient",
            name="artifact",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="links_patient",
                to="lamindb.artifact",
            ),
        ),
        migrations.AlterField(
            model_name="artifactpatient",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="artifactpatient",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="artifactpatient",
            name="feature",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifactpatient",
                to="lamindb.feature",
            ),
        ),
        migrations.AlterField(
            model_name="artifactpatient",
            name="feature_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifactpatient",
            name="label_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifactpatient",
            name="patient",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifact",
                to="clinicore.patient",
            ),
        ),
        migrations.AlterField(
            model_name="artifactpatient",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="artifacttreatment",
            name="artifact",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="links_treatment",
                to="lamindb.artifact",
            ),
        ),
        migrations.AlterField(
            model_name="artifacttreatment",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="artifacttreatment",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="artifacttreatment",
            name="feature",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifacttreatment",
                to="lamindb.feature",
            ),
        ),
        migrations.AlterField(
            model_name="artifacttreatment",
            name="feature_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifacttreatment",
            name="label_ref_is_name",
            field=lamindb.base.fields.BooleanField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="artifacttreatment",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="artifacttreatment",
            name="treatment",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="links_artifact",
                to="clinicore.treatment",
            ),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="batch",
            field=lamindb.base.fields.CharField(
                blank=True, db_index=True, default=None, max_length=60, null=True
            ),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="clinical_trial",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="biosamples",
                to="clinicore.clinicaltrial",
            ),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="description",
            field=lamindb.base.fields.TextField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="name",
            field=lamindb.base.fields.CharField(
                blank=True, db_index=True, default=None, max_length=255, null=True
            ),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="patient",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="biosamples",
                to="clinicore.patient",
            ),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="uid",
            field=lamindb.base.fields.CharField(
                blank=True,
                default=lamindb.base.ids.base62_12,
                max_length=12,
                unique=True,
            ),
        ),
        migrations.AlterField(
            model_name="biosample",
            name="updated_at",
            field=lamindb.base.fields.DateTimeField(auto_now=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="clinicaltrial",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="clinicaltrial",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="clinicaltrial",
            name="description",
            field=lamindb.base.fields.TextField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="clinicaltrial",
            name="name",
            field=lamindb.base.fields.CharField(
                blank=True, db_index=True, default=None, max_length=255
            ),
        ),
        migrations.AlterField(
            model_name="clinicaltrial",
            name="objective",
            field=lamindb.base.fields.TextField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="clinicaltrial",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="clinicaltrial",
            name="title",
            field=lamindb.base.fields.TextField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="clinicaltrial",
            name="uid",
            field=lamindb.base.fields.CharField(
                blank=True,
                default=lamindb.base.ids.base62_8,
                max_length=8,
                unique=True,
            ),
        ),
        migrations.AlterField(
            model_name="clinicaltrial",
            name="updated_at",
            field=lamindb.base.fields.DateTimeField(auto_now=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="medication",
            name="abbr",
            field=lamindb.base.fields.CharField(
                blank=True,
                db_index=True,
                default=None,
                max_length=32,
                null=True,
                unique=True,
            ),
        ),
        migrations.AlterField(
            model_name="medication",
            name="chembl_id",
            field=lamindb.base.fields.CharField(
                blank=True, db_index=True, default=None, max_length=32, null=True
            ),
        ),
        migrations.AlterField(
            model_name="medication",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="medication",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="medication",
            name="description",
            field=lamindb.base.fields.TextField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="medication",
            name="name",
            field=lamindb.base.fields.CharField(
                blank=True, db_index=True, default=None, max_length=256
            ),
        ),
        migrations.AlterField(
            model_name="medication",
            name="ontology_id",
            field=lamindb.base.fields.CharField(
                blank=True, db_index=True, default=None, max_length=32, null=True
            ),
        ),
        migrations.AlterField(
            model_name="medication",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="medication",
            name="source",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="bionty.source",
            ),
        ),
        migrations.AlterField(
            model_name="medication",
            name="synonyms",
            field=lamindb.base.fields.TextField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="medication",
            name="uid",
            field=lamindb.base.fields.CharField(
                blank=True, default=bionty.ids.ontology, max_length=8, unique=True
            ),
        ),
        migrations.AlterField(
            model_name="medication",
            name="updated_at",
            field=lamindb.base.fields.DateTimeField(auto_now=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="patient",
            name="age",
            field=lamindb.base.fields.IntegerField(
                blank=True, db_index=True, default=None, null=True
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="birth_date",
            field=lamindb.base.fields.DateField(
                blank=True, db_index=True, default=None, null=True
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="patient",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="deceased",
            field=lamindb.base.fields.BooleanField(
                blank=True, db_index=True, default=None, null=True
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="deceased_date",
            field=lamindb.base.fields.DateField(
                blank=True, db_index=True, default=None, null=True
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="ethnicity",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="bionty.ethnicity",
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="gender",
            field=lamindb.base.fields.CharField(
                blank=True,
                choices=[
                    ("male", "Male"),
                    ("female", "Female"),
                    ("other", "Other"),
                    ("unknown", "Unknown"),
                ],
                db_index=True,
                default=None,
                max_length=10,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="name",
            field=lamindb.base.fields.CharField(
                blank=True, db_index=True, default=None, max_length=255
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="uid",
            field=lamindb.base.fields.CharField(
                blank=True,
                default=lamindb.base.ids.base62_12,
                max_length=12,
                unique=True,
            ),
        ),
        migrations.AlterField(
            model_name="patient",
            name="updated_at",
            field=lamindb.base.fields.DateTimeField(auto_now=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="administered_datetime",
            field=lamindb.base.fields.DateTimeField(
                blank=True, default=None, null=True
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="created_at",
            field=lamindb.base.fields.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="created_by",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.user",
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="dosage",
            field=lamindb.base.fields.FloatField(blank=True, default=None, null=True),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="dosage_unit",
            field=lamindb.base.fields.CharField(
                blank=True, default=None, max_length=32, null=True
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="duration",
            field=lamindb.base.fields.DurationField(
                blank=True, default=None, null=True
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="medication",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="clinicore.medication",
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="name",
            field=lamindb.base.fields.CharField(
                blank=True, db_index=True, default=None, max_length=255
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="route",
            field=lamindb.base.fields.CharField(
                blank=True, default=None, max_length=32, null=True
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="run",
            field=lamindb.base.fields.ForeignKey(
                blank=True,
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="lamindb.run",
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="site",
            field=lamindb.base.fields.CharField(
                blank=True, default=None, max_length=32, null=True
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="status",
            field=lamindb.base.fields.CharField(
                blank=True,
                choices=[
                    ("in-progress", "In Progress"),
                    ("completed", "Completed"),
                    ("entered-in-error", "Entered in Error"),
                    ("stopped", "Stopped"),
                    ("on-hold", "On Hold"),
                    ("unknown", "Unknown"),
                    ("not-done", "Not Done"),
                ],
                default=None,
                max_length=16,
                null=True,
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="uid",
            field=lamindb.base.fields.CharField(
                blank=True,
                default=lamindb.base.ids.base62_12,
                max_length=12,
                unique=True,
            ),
        ),
        migrations.AlterField(
            model_name="treatment",
            name="updated_at",
            field=lamindb.base.fields.DateTimeField(auto_now=True, db_index=True),
        ),
    ]
