# Generated by Django 5.0.6 on 2024-05-16 15:59

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

import bionty.ids


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("lnschema_core", "0037_rename_dataset_to_collection"),
    ]

    operations = [
        migrations.CreateModel(
            name="Organism",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, default=None, max_length=64, unique=True
                    ),
                ),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                (
                    "scientific_name",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=64,
                        null=True,
                        unique=True,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="organism", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="organism", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_organism",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.organism"
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="PublicSource",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.publicsource,
                        max_length=8,
                        unique=True,
                    ),
                ),
                ("entity", models.CharField(db_index=True, max_length=64)),
                ("organism", models.CharField(db_index=True, max_length=64)),
                ("currently_used", models.BooleanField(db_index=True, default=False)),
                ("source", models.CharField(db_index=True, max_length=64)),
                ("source_name", models.TextField(blank=True, db_index=True)),
                ("version", models.CharField(db_index=True, max_length=64)),
                ("url", models.TextField(default=None, null=True)),
                ("md5", models.TextField(default=None, null=True)),
                ("source_website", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_public_sources",
                        to="lnschema_core.user",
                    ),
                ),
            ],
            options={
                "unique_together": {("entity", "source", "organism", "version")},
            },
        ),
        migrations.CreateModel(
            name="Protein",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.protein, max_length=12, unique=True
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, default=None, max_length=64, null=True
                    ),
                ),
                (
                    "uniprotkb_id",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=10,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("length", models.BigIntegerField(db_index=True, null=True)),
                (
                    "gene_symbol",
                    models.CharField(
                        db_index=True, default=None, max_length=64, null=True
                    ),
                ),
                ("ensembl_gene_ids", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="proteins", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="proteins", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_proteins",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "feature_sets",
                    models.ManyToManyField(
                        related_name="proteins", to="lnschema_core.featureset"
                    ),
                ),
                (
                    "organism",
                    models.ForeignKey(
                        default=None,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="proteins",
                        to="bionty.organism",
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="proteins",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.AddField(
            model_name="organism",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="organisms",
                to="bionty.publicsource",
            ),
        ),
        migrations.CreateModel(
            name="Gene",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.gene, max_length=12, unique=True
                    ),
                ),
                (
                    "symbol",
                    models.CharField(
                        db_index=True, default=None, max_length=64, null=True
                    ),
                ),
                (
                    "stable_id",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=64,
                        null=True,
                        unique=True,
                    ),
                ),
                (
                    "ensembl_gene_id",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=64,
                        null=True,
                        unique=True,
                    ),
                ),
                ("ncbi_gene_ids", models.TextField(default=None, null=True)),
                (
                    "biotype",
                    models.CharField(
                        db_index=True, default=None, max_length=64, null=True
                    ),
                ),
                ("description", models.TextField(default=None, null=True)),
                ("synonyms", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="genes", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="genes", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_genes",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "feature_sets",
                    models.ManyToManyField(
                        related_name="genes", to="lnschema_core.featureset"
                    ),
                ),
                (
                    "organism",
                    models.ForeignKey(
                        default=None,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="genes",
                        to="bionty.organism",
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="genes",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="CellMarker",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.cellmarker,
                        max_length=12,
                        unique=True,
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, default=None, max_length=64, unique=True
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                (
                    "gene_symbol",
                    models.CharField(
                        db_index=True, default=None, max_length=64, null=True
                    ),
                ),
                (
                    "ncbi_gene_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "uniprotkb_id",
                    models.CharField(
                        db_index=True, default=None, max_length=10, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="cell_markers", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="cell_markers", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_cell_markers",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "feature_sets",
                    models.ManyToManyField(
                        related_name="cell_markers", to="lnschema_core.featureset"
                    ),
                ),
                (
                    "organism",
                    models.ForeignKey(
                        default=None,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="cell_markers",
                        to="bionty.organism",
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="cell_markers",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="Phenotype",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="phenotypes", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="phenotypes", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_phenotypes",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.phenotype"
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="phenotypes",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="Pathway",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="pathways", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="pathways", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_pathways",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "feature_sets",
                    models.ManyToManyField(
                        related_name="pathways", to="lnschema_core.featureset"
                    ),
                ),
                (
                    "genes",
                    models.ManyToManyField(related_name="pathways", to="bionty.gene"),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.pathway"
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="pathways",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="ExperimentalFactor",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("molecule", models.TextField(db_index=True, default=None, null=True)),
                (
                    "instrument",
                    models.TextField(db_index=True, default=None, null=True),
                ),
                (
                    "measurement",
                    models.TextField(db_index=True, default=None, null=True),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="experimental_factors", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="experimental_factors",
                        to="lnschema_core.collection",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_experimental_factors",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.experimentalfactor"
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="experimental_factors",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="Ethnicity",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="ethnicities", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="ethnicities", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_ethnicities",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.ethnicity"
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="ethnicities",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="Disease",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="diseases", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="diseases", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_diseases",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.disease"
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="diseases",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="DevelopmentalStage",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="developmental_stages", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="developmental_stages",
                        to="lnschema_core.collection",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_developmental_stages",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.developmentalstage"
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="developmental_stages",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="CellType",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="cell_types", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="cell_types", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_cell_types",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.celltype"
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="cell_types",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="CellLine",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="cell_lines", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="cell_lines", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_cell_lines",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.cellline"
                    ),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="cell_lines",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="Tissue",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.ontology, max_length=8, unique=True
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="tissues", to="lnschema_core.artifact"
                    ),
                ),
                (
                    "collections",
                    models.ManyToManyField(
                        related_name="tissues", to="lnschema_core.collection"
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_tissues",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(related_name="children", to="bionty.tissue"),
                ),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="tissues",
                        to="bionty.publicsource",
                    ),
                ),
            ],
            options={
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
    ]
