# Generated by Django 5.0.6 on 2024-05-19 11:58

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

import lamindb.base.ids
import lamindb.base.types
import lamindb.base.users
import lamindb.models


class Migration(migrations.Migration):
    initial = True
    dependencies = []  # type: ignore

    operations = [
        migrations.CreateModel(
            name="Artifact",
            fields=[
                (
                    "version",
                    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)),
                ("id", models.AutoField(primary_key=True, serialize=False)),
                ("uid", models.CharField(db_index=True, max_length=20, unique=True)),
                (
                    "key",
                    models.CharField(
                        db_index=True, default=None, max_length=255, null=True
                    ),
                ),
                (
                    "suffix",
                    models.CharField(db_index=True, default=None, max_length=30),
                ),
                (
                    "accessor",
                    models.CharField(
                        db_index=True, default=None, max_length=64, null=True
                    ),
                ),
                (
                    "description",
                    models.CharField(
                        db_index=True, default=None, max_length=255, null=True
                    ),
                ),
                ("size", models.BigIntegerField(db_index=True, null=True)),
                (
                    "hash",
                    models.CharField(
                        db_index=True, default=None, max_length=86, null=True
                    ),
                ),
                (
                    "hash_type",
                    models.CharField(
                        db_index=True, default=None, max_length=30, null=True
                    ),
                ),
                (
                    "n_objects",
                    models.BigIntegerField(db_index=True, default=None, null=True),
                ),
                (
                    "n_observations",
                    models.BigIntegerField(db_index=True, default=None, null=True),
                ),
                (
                    "visibility",
                    models.SmallIntegerField(
                        choices=[(1, "Default"), (0, "Hidden"), (-1, "Trash")],
                        db_index=True,
                        default=1,
                    ),
                ),
                ("key_is_virtual", models.BooleanField()),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Feature",
            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(
                        db_index=True,
                        default=lamindb.base.ids.base62_12,
                        max_length=12,
                        unique=True,
                    ),
                ),
                ("name", models.CharField(db_index=True, default=None, max_length=150)),
                ("dtype", models.CharField(db_index=True, default=None, max_length=64)),
                (
                    "unit",
                    models.CharField(
                        db_index=True, default=None, max_length=30, null=True
                    ),
                ),
                (
                    "description",
                    models.TextField(db_index=True, default=None, null=True),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.CanCurate, models.Model),
        ),
        migrations.CreateModel(
            name="FeatureSet",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True, default=None, max_length=20, unique=True
                    ),
                ),
                ("name", models.CharField(default=None, max_length=150, null=True)),
                ("n", models.IntegerField()),
                ("dtype", models.CharField(default=None, max_length=64, null=True)),
                ("registry", models.CharField(db_index=True, max_length=120)),
                (
                    "hash",
                    models.CharField(
                        db_index=True, default=None, max_length=20, null=True
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Param",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                ("name", models.CharField(db_index=True, max_length=100)),
                ("dtype", models.CharField(db_index=True, default=None, max_length=64)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="User",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True, default=None, max_length=8, unique=True
                    ),
                ),
                (
                    "handle",
                    models.CharField(
                        db_index=True, default=None, max_length=30, unique=True
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, default=None, max_length=150, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
            ],
            options={
                "abstract": False,
            },
            bases=(models.Model, lamindb.models.CanCurate),
        ),
        migrations.CreateModel(
            name="Collection",
            fields=[
                (
                    "version",
                    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)),
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True,
                        default=lamindb.base.ids.base62_20,
                        max_length=20,
                        unique=True,
                    ),
                ),
                ("name", models.CharField(db_index=True, default=None, max_length=150)),
                ("description", models.TextField(default=None, null=True)),
                (
                    "hash",
                    models.CharField(
                        db_index=True, default=None, max_length=86, null=True
                    ),
                ),
                (
                    "reference",
                    models.CharField(
                        db_index=True, default=None, max_length=255, null=True
                    ),
                ),
                (
                    "reference_type",
                    models.CharField(
                        db_index=True, default=None, max_length=25, null=True
                    ),
                ),
                (
                    "visibility",
                    models.SmallIntegerField(
                        choices=[(1, "Default"), (0, "Hidden"), (-1, "Trash")],
                        db_index=True,
                        default=1,
                    ),
                ),
                (
                    "artifact",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="collection",
                        to="lamindb.artifact",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="CollectionArtifact",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="collection_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "collection",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="artifact_links",
                        to="lamindb.collection",
                    ),
                ),
            ],
            bases=(lamindb.models.LinkORM, models.Model),
        ),
        migrations.AddField(
            model_name="collection",
            name="unordered_artifacts",
            field=models.ManyToManyField(
                related_name="collections",
                through="lamindb.CollectionArtifact",
                to="lamindb.artifact",
            ),
        ),
        migrations.CreateModel(
            name="CollectionFeatureSet",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("slot", models.CharField(default=None, max_length=50, null=True)),
                (
                    "feature_ref_is_semantic",
                    models.BooleanField(default=None, null=True),
                ),
                (
                    "collection",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="feature_set_links",
                        to="lamindb.collection",
                    ),
                ),
                (
                    "featureset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="collection_links",
                        to="lamindb.featureset",
                    ),
                ),
            ],
            bases=(lamindb.models.LinkORM, models.Model),
        ),
        migrations.AddField(
            model_name="collection",
            name="feature_sets",
            field=models.ManyToManyField(
                related_name="collections",
                through="lamindb.CollectionFeatureSet",
                to="lamindb.featureset",
            ),
        ),
        migrations.CreateModel(
            name="ArtifactFeatureSet",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("slot", models.CharField(default=None, max_length=40, null=True)),
                (
                    "feature_ref_is_semantic",
                    models.BooleanField(default=None, null=True),
                ),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="feature_set_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "featureset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifact_links",
                        to="lamindb.featureset",
                    ),
                ),
            ],
            bases=(lamindb.models.LinkORM, models.Model),
        ),
        migrations.AddField(
            model_name="artifact",
            name="feature_sets",
            field=models.ManyToManyField(
                related_name="artifacts",
                through="lamindb.ArtifactFeatureSet",
                to="lamindb.featureset",
            ),
        ),
        migrations.CreateModel(
            name="FeatureSetFeature",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "feature",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "featureset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="lamindb.featureset",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(models.Model, lamindb.models.LinkORM),
        ),
        migrations.AddField(
            model_name="feature",
            name="feature_sets",
            field=models.ManyToManyField(
                related_name="features",
                through="lamindb.FeatureSetFeature",
                to="lamindb.featureset",
            ),
        ),
        migrations.CreateModel(
            name="FeatureValue",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("value", models.JSONField()),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lamindb.feature",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="ArtifactFeatureValue",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "artifact",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "featurevalue",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="lamindb.featurevalue",
                    ),
                ),
            ],
            bases=(lamindb.models.LinkORM, models.Model),
        ),
        migrations.AddField(
            model_name="artifact",
            name="feature_values",
            field=models.ManyToManyField(
                through="lamindb.ArtifactFeatureValue",
                to="lamindb.featurevalue",
            ),
        ),
        migrations.CreateModel(
            name="ParamValue",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("value", models.JSONField()),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                (
                    "param",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lamindb.param",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_transforms",
                        to="lamindb.user",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Run",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True,
                        default=lamindb.base.ids.base62_20,
                        max_length=20,
                        unique=True,
                    ),
                ),
                ("started_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                (
                    "finished_at",
                    models.DateTimeField(db_index=True, default=None, null=True),
                ),
                ("is_consecutive", models.BooleanField(default=None, null=True)),
                (
                    "reference",
                    models.CharField(
                        db_index=True, default=None, max_length=255, null=True
                    ),
                ),
                (
                    "reference_type",
                    models.CharField(
                        db_index=True, default=None, max_length=25, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                (
                    "environment",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="environment_of",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "report",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="report_of",
                        to="lamindb.artifact",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="param",
            name="previous_runs",
            field=models.ManyToManyField(to="lamindb.run"),
        ),
        migrations.AddField(
            model_name="param",
            name="run",
            field=models.ForeignKey(
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="featurevalue",
            name="run",
            field=models.ForeignKey(
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="featureset",
            name="run",
            field=models.ForeignKey(
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="feature",
            name="previous_runs",
            field=models.ManyToManyField(to="lamindb.run"),
        ),
        migrations.AddField(
            model_name="feature",
            name="run",
            field=models.ForeignKey(
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="collectionfeatureset",
            name="run",
            field=models.ForeignKey(
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="collectionartifact",
            name="run",
            field=models.ForeignKey(
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="collection",
            name="input_of",
            field=models.ManyToManyField(
                related_name="input_collections", to="lamindb.run"
            ),
        ),
        migrations.AddField(
            model_name="collection",
            name="previous_runs",
            field=models.ManyToManyField(
                related_name="output_collections_with_later_updates",
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="collection",
            name="run",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_collections",
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="artifactfeaturevalue",
            name="run",
            field=models.ForeignKey(
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="artifactfeatureset",
            name="run",
            field=models.ForeignKey(
                default=lamindb.models.current_run,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="artifact",
            name="input_of",
            field=models.ManyToManyField(
                related_name="input_artifacts", to="lamindb.run"
            ),
        ),
        migrations.AddField(
            model_name="artifact",
            name="previous_runs",
            field=models.ManyToManyField(
                related_name="output_artifacts_with_later_updates",
                to="lamindb.run",
            ),
        ),
        migrations.AddField(
            model_name="artifact",
            name="run",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_artifacts",
                to="lamindb.run",
            ),
        ),
        migrations.CreateModel(
            name="RunParamValue",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "paramvalue",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="lamindb.paramvalue",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="lamindb.run",
                    ),
                ),
            ],
            options={
                "unique_together": {("run", "paramvalue")},
            },
            bases=(models.Model, lamindb.models.LinkORM),
        ),
        migrations.AddField(
            model_name="run",
            name="param_values",
            field=models.ManyToManyField(
                related_name="runs",
                through="lamindb.RunParamValue",
                to="lamindb.paramvalue",
            ),
        ),
        migrations.CreateModel(
            name="Storage",
            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(
                        db_index=True,
                        default=lamindb.base.ids.base62_12,
                        max_length=12,
                        unique=True,
                    ),
                ),
                (
                    "root",
                    models.CharField(
                        db_index=True, default=None, max_length=255, unique=True
                    ),
                ),
                (
                    "description",
                    models.CharField(
                        db_index=True, default=None, max_length=255, null=True
                    ),
                ),
                ("type", models.CharField(db_index=True, max_length=30)),
                (
                    "region",
                    models.CharField(
                        db_index=True, default=None, max_length=64, null=True
                    ),
                ),
                (
                    "instance_uid",
                    models.CharField(
                        db_index=True, default=None, max_length=12, null=True
                    ),
                ),
                ("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",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="artifact",
            name="storage",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifacts",
                to="lamindb.storage",
            ),
        ),
        migrations.CreateModel(
            name="Transform",
            fields=[
                (
                    "version",
                    models.CharField(
                        db_index=True, default=None, max_length=10, null=True
                    ),
                ),
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True, default=None, max_length=16, unique=True
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, default=None, max_length=150, null=True
                    ),
                ),
                (
                    "key",
                    models.CharField(
                        db_index=True, default=None, max_length=120, null=True
                    ),
                ),
                (
                    "description",
                    models.CharField(default=None, max_length=255, null=True),
                ),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("pipeline", "pipeline"),
                            ("notebook", "notebook"),
                            ("upload", "upload"),
                            ("script", "script"),
                            ("function", "function"),
                        ],
                        db_index=True,
                        default="pipeline",
                        max_length=20,
                    ),
                ),
                (
                    "reference",
                    models.CharField(
                        db_index=True, default=None, max_length=255, null=True
                    ),
                ),
                (
                    "reference_type",
                    models.CharField(
                        db_index=True, default=None, max_length=25, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "latest_report",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="latest_report_of",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="lamindb.transform"
                    ),
                ),
                (
                    "source_code",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="source_code_of",
                        to="lamindb.artifact",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(lamindb.models.HasParents, models.Model),
        ),
        migrations.AddField(
            model_name="run",
            name="transform",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="runs",
                to="lamindb.transform",
            ),
        ),
        migrations.AddField(
            model_name="collection",
            name="transform",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_collections",
                to="lamindb.transform",
            ),
        ),
        migrations.AddField(
            model_name="artifact",
            name="transform",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_artifacts",
                to="lamindb.transform",
            ),
        ),
        migrations.CreateModel(
            name="ULabel",
            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(
                        db_index=True,
                        default=lamindb.base.ids.base62_8,
                        max_length=8,
                        unique=True,
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, default=None, max_length=150, unique=True
                    ),
                ),
                ("description", models.TextField(default=None, null=True)),
                (
                    "reference",
                    models.CharField(
                        db_index=True, default=None, max_length=255, null=True
                    ),
                ),
                (
                    "reference_type",
                    models.CharField(
                        db_index=True, default=None, max_length=25, null=True
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="lamindb.ulabel"
                    ),
                ),
                ("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",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                lamindb.models.HasParents,
                lamindb.models.CanCurate,
                models.Model,
            ),
        ),
        migrations.AddField(
            model_name="transform",
            name="ulabels",
            field=models.ManyToManyField(
                related_name="transforms", to="lamindb.ulabel"
            ),
        ),
        migrations.CreateModel(
            name="CollectionULabel",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("ulabel_ref_is_name", models.BooleanField(default=None, null=True)),
                ("feature_ref_is_name", models.BooleanField(default=None, null=True)),
                (
                    "collection",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ulabel_links",
                        to="lamindb.collection",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="collectionulabel_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
                (
                    "ulabel",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="collection_links",
                        to="lamindb.ulabel",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
            ],
            options={
                "unique_together": {("collection", "ulabel")},
            },
            bases=(lamindb.models.LinkORM, models.Model),
        ),
        migrations.AddField(
            model_name="collection",
            name="ulabels",
            field=models.ManyToManyField(
                related_name="collections",
                through="lamindb.CollectionULabel",
                to="lamindb.ulabel",
            ),
        ),
        migrations.CreateModel(
            name="ArtifactULabel",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("ulabel_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="ulabel_links",
                        to="lamindb.artifact",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifactulabel_links",
                        to="lamindb.feature",
                    ),
                ),
                (
                    "run",
                    models.ForeignKey(
                        default=lamindb.models.current_run,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.run",
                    ),
                ),
                (
                    "ulabel",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="artifact_links",
                        to="lamindb.ulabel",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lamindb.base.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lamindb.user",
                    ),
                ),
            ],
            options={
                "unique_together": {("artifact", "ulabel")},
            },
            bases=(lamindb.models.LinkORM, models.Model),
        ),
        migrations.AddField(
            model_name="artifact",
            name="ulabels",
            field=models.ManyToManyField(
                related_name="artifacts",
                through="lamindb.ArtifactULabel",
                to="lamindb.ulabel",
            ),
        ),
        migrations.AddField(
            model_name="transform",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="created_transforms",
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="run",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="created_runs",
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="param",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="featurevalue",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="featureset",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="feature",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="collectionfeatureset",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="collectionartifact",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="collection",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="artifactfeaturevalue",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="artifactfeatureset",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AddField(
            model_name="artifact",
            name="created_by",
            field=models.ForeignKey(
                default=lamindb.base.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                to="lamindb.user",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="collectionfeatureset",
            unique_together={("collection", "featureset")},
        ),
        migrations.AlterUniqueTogether(
            name="collectionartifact",
            unique_together={("collection", "artifact")},
        ),
        migrations.AlterUniqueTogether(
            name="artifactfeaturevalue",
            unique_together={("artifact", "featurevalue")},
        ),
        migrations.AlterUniqueTogether(
            name="artifactfeatureset",
            unique_together={("artifact", "featureset")},
        ),
    ]
