# Generated by Django 5.0.6 on 2024-05-19 12:01

import django.db.models.deletion
import lamindb.base.users
import lamindb.models
from django.db import migrations, models

import bionty.ids


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("lamindb", "0070_lamindbv1_migrate_data"),
    ]

    operations = [
        migrations.CreateModel(
            name="ArtifactCellLine",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("cell_line_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cell_line_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactcellline_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactCellMarker",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "cell_marker_ref_is_name",
                    models.BooleanField(default=None, null=True),
                ),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cell_marker_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactcellmarker_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactCellType",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("cell_type_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="cell_type_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactcelltype_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactDevelopmentalStage",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "developmental_stage_ref_is_name",
                    models.BooleanField(default=None, null=True),
                ),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="developmental_stage_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactdevelopmentalstage_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactDisease",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("disease_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="disease_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactdisease_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactEthnicity",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("ethnicity_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ethnicity_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactethnicity_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactExperimentalFactor",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "experimental_factor_ref_is_name",
                    models.BooleanField(default=None, null=True),
                ),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="experimental_factor_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactexperimentalfactor_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactGene",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("gene_ref_is_symbol", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_symbol", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="gene_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactgene_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactOrganism",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("organism_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="organism_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactorganism_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactPathway",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("pathway_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="pathway_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactpathway_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactPhenotype",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("phenotype_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="phenotype_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactphenotype_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactProtein",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("protein_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="protein_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactprotein_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="ArtifactTissue",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("tissue_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="tissue_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifacttissue_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.IsLink, models.Model),
        ),
        migrations.CreateModel(
            name="CellLine",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="cell_lines",
                        through="bionty.ArtifactCellLine",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.cellline"
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="artifactcellline",
            name="cellline",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.cellline",
            ),
        ),
        migrations.CreateModel(
            name="CellMarker",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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
                    ),
                ),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="cell_markers",
                        through="bionty.ArtifactCellMarker",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="artifactcellmarker",
            name="cellmarker",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.cellmarker",
            ),
        ),
        migrations.CreateModel(
            name="CellType",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="cell_types",
                        through="bionty.ArtifactCellType",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.celltype"
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="artifactcelltype",
            name="celltype",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.celltype",
            ),
        ),
        migrations.CreateModel(
            name="DevelopmentalStage",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="developmental_stages",
                        through="bionty.ArtifactDevelopmentalStage",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.developmentalstage"
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="artifactdevelopmentalstage",
            name="developmentalstage",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.developmentalstage",
            ),
        ),
        migrations.CreateModel(
            name="Disease",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="diseases",
                        through="bionty.ArtifactDisease",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.disease"
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="artifactdisease",
            name="disease",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.disease",
            ),
        ),
        migrations.CreateModel(
            name="Ethnicity",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="ethnicities",
                        through="bionty.ArtifactEthnicity",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.ethnicity"
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="artifactethnicity",
            name="ethnicity",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.ethnicity",
            ),
        ),
        migrations.CreateModel(
            name="ExperimentalFactor",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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),
                ),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="experimental_factors",
                        through="bionty.ArtifactExperimentalFactor",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.experimentalfactor"
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="artifactexperimentalfactor",
            name="experimental_factor",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.experimentalfactor",
            ),
        ),
        migrations.CreateModel(
            name="FeatureSetCellMarker",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "cellmarker",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="bionty.cellmarker",
                    ),
                ),
                (
                    "featureset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="lamindb.featureset",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(models.Model, lamindb.models.IsLink),
        ),
        migrations.AddField(
            model_name="cellmarker",
            name="feature_sets",
            field=models.ManyToManyField(
                related_name="cell_markers",
                through="bionty.FeatureSetCellMarker",
                to="lamindb.featureset",
            ),
        ),
        migrations.CreateModel(
            name="FeatureSetGene",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "featureset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="lamindb.featureset",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(models.Model, lamindb.models.IsLink),
        ),
        migrations.CreateModel(
            name="FeatureSetPathway",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "featureset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="lamindb.featureset",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(models.Model, lamindb.models.IsLink),
        ),
        migrations.CreateModel(
            name="FeatureSetProtein",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "featureset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="lamindb.featureset",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(models.Model, lamindb.models.IsLink),
        ),
        migrations.CreateModel(
            name="Gene",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="genes",
                        through="bionty.ArtifactGene",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature_sets",
                    models.ManyToManyField(
                        related_name="genes",
                        through="bionty.FeatureSetGene",
                        to="lamindb.featureset",
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="featuresetgene",
            name="gene",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="bionty.gene",
            ),
        ),
        migrations.AddField(
            model_name="artifactgene",
            name="gene",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.gene",
            ),
        ),
        migrations.CreateModel(
            name="Organism",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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,
                    ),
                ),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="organisms",
                        through="bionty.ArtifactOrganism",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.organism"
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="gene",
            name="organism",
            field=models.ForeignKey(
                default=None,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="genes",
                to="bionty.organism",
            ),
        ),
        migrations.AddField(
            model_name="cellmarker",
            name="organism",
            field=models.ForeignKey(
                default=None,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="cell_markers",
                to="bionty.organism",
            ),
        ),
        migrations.AddField(
            model_name="artifactorganism",
            name="organism",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.organism",
            ),
        ),
        migrations.CreateModel(
            name="Pathway",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="pathways",
                        through="bionty.ArtifactPathway",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature_sets",
                    models.ManyToManyField(
                        related_name="pathways",
                        through="bionty.FeatureSetPathway",
                        to="lamindb.featureset",
                    ),
                ),
                (
                    "genes",
                    models.ManyToManyField(related_name="pathways", to="bionty.gene"),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.pathway"
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="featuresetpathway",
            name="pathway",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="bionty.pathway",
            ),
        ),
        migrations.AddField(
            model_name="artifactpathway",
            name="pathway",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.pathway",
            ),
        ),
        migrations.CreateModel(
            name="Phenotype",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="phenotypes",
                        through="bionty.ArtifactPhenotype",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="bionty.phenotype"
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="artifactphenotype",
            name="phenotype",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.phenotype",
            ),
        ),
        migrations.CreateModel(
            name="Protein",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="proteins",
                        through="bionty.ArtifactProtein",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "feature_sets",
                    models.ManyToManyField(
                        related_name="proteins",
                        through="bionty.FeatureSetProtein",
                        to="lamindb.featureset",
                    ),
                ),
                (
                    "organism",
                    models.ForeignKey(
                        default=None,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="proteins",
                        to="bionty.organism",
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="featuresetprotein",
            name="protein",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="+",
                to="bionty.protein",
            ),
        ),
        migrations.AddField(
            model_name="artifactprotein",
            name="protein",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.protein",
            ),
        ),
        migrations.CreateModel(
            name="PublicSource",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        default=bionty.ids.source,
                        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_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "unique_together": {("entity", "source", "organism", "version")},
            },
        ),
        migrations.AddField(
            model_name="protein",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="proteins",
                to="bionty.publicsource",
            ),
        ),
        migrations.AddField(
            model_name="phenotype",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="phenotypes",
                to="bionty.publicsource",
            ),
        ),
        migrations.AddField(
            model_name="pathway",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="pathways",
                to="bionty.publicsource",
            ),
        ),
        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.AddField(
            model_name="gene",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="genes",
                to="bionty.publicsource",
            ),
        ),
        migrations.AddField(
            model_name="experimentalfactor",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="experimental_factors",
                to="bionty.publicsource",
            ),
        ),
        migrations.AddField(
            model_name="ethnicity",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="ethnicities",
                to="bionty.publicsource",
            ),
        ),
        migrations.AddField(
            model_name="disease",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="diseases",
                to="bionty.publicsource",
            ),
        ),
        migrations.AddField(
            model_name="developmentalstage",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="developmental_stages",
                to="bionty.publicsource",
            ),
        ),
        migrations.AddField(
            model_name="celltype",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="cell_types",
                to="bionty.publicsource",
            ),
        ),
        migrations.AddField(
            model_name="cellmarker",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="cell_markers",
                to="bionty.publicsource",
            ),
        ),
        migrations.AddField(
            model_name="cellline",
            name="public_source",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="cell_lines",
                to="bionty.publicsource",
            ),
        ),
        migrations.CreateModel(
            name="Tissue",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("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)),
                (
                    "artifacts",
                    models.ManyToManyField(
                        related_name="tissues",
                        through="bionty.ArtifactTissue",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(related_name="children", to="bionty.tissue"),
                ),
                ("previous_runs", models.ManyToManyField(to="lamindb.run")),
                (
                    "public_source",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="tissues",
                        to="bionty.publicsource",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "unique_together": {("name", "ontology_id")},
            },
            bases=(
                models.Model,
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
            ),
        ),
        migrations.AddField(
            model_name="artifacttissue",
            name="tissue",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifact_links",
                to="bionty.tissue",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="phenotype",
            unique_together={("name", "ontology_id")},
        ),
        migrations.AlterUniqueTogether(
            name="pathway",
            unique_together={("name", "ontology_id")},
        ),
        migrations.AlterUniqueTogether(
            name="experimentalfactor",
            unique_together={("name", "ontology_id")},
        ),
        migrations.AlterUniqueTogether(
            name="ethnicity",
            unique_together={("name", "ontology_id")},
        ),
        migrations.AlterUniqueTogether(
            name="disease",
            unique_together={("name", "ontology_id")},
        ),
        migrations.AlterUniqueTogether(
            name="developmentalstage",
            unique_together={("name", "ontology_id")},
        ),
        migrations.AlterUniqueTogether(
            name="celltype",
            unique_together={("name", "ontology_id")},
        ),
        migrations.AlterUniqueTogether(
            name="cellline",
            unique_together={("name", "ontology_id")},
        ),
    ]
