# Generated by Django 5.0.6 on 2024-05-16 13:50

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

import lnschema_core.ids
import lnschema_core.models
import lnschema_core.types
import lnschema_core.users


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

    operations = [
        migrations.CreateModel(
            name="Dataset",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True,
                        default=lnschema_core.ids.base62_20,
                        max_length=20,
                        unique=True,
                    ),
                ),
                ("name", models.CharField(db_index=True, default=None, max_length=255)),
                ("description", models.TextField(default=None, null=True)),
                (
                    "version",
                    models.CharField(
                        db_index=True, default=None, max_length=10, 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=255, 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, lnschema_core.models.HasFeatures),
        ),
        migrations.CreateModel(
            name="Feature",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True,
                        default=lnschema_core.ids.base62_12,
                        max_length=12,
                        unique=True,
                    ),
                ),
                ("name", models.CharField(db_index=True, default=None, max_length=255)),
                ("type", 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),
                ),
                (
                    "registries",
                    models.CharField(
                        db_index=True, default=None, max_length=128, null=True
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
            ],
            options={
                "abstract": False,
            },
            bases=(models.Model, lnschema_core.models.CanValidate),
        ),
        migrations.CreateModel(
            name="FeatureSet",
            fields=[
                ("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=128, null=True)),
                ("n", models.IntegerField()),
                ("type", models.CharField(default=None, max_length=64, null=True)),
                ("registry", models.CharField(db_index=True, max_length=128)),
                (
                    "hash",
                    models.CharField(
                        db_index=True, default=None, max_length=20, 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,
            },
        ),
        migrations.CreateModel(
            name="File",
            fields=[
                ("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
                    ),
                ),
                (
                    "version",
                    models.CharField(
                        db_index=True, default=None, max_length=10, 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
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
            ],
            bases=(models.Model, lnschema_core.models.HasFeatures),
        ),
        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
                    ),
                ),
                (
                    "email",
                    models.CharField(
                        db_index=True, default=None, max_length=255, unique=True
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, default=None, max_length=255, 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, lnschema_core.models.CanValidate),
        ),
        migrations.CreateModel(
            name="ULabel",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True,
                        default=lnschema_core.ids.base62_8,
                        max_length=8,
                        unique=True,
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, default=None, max_length=255, 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=255, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_ulabels",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="lnschema_core.ulabel"
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="Transform",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True, default=None, max_length=14, unique=True
                    ),
                ),
                (
                    "name",
                    models.CharField(
                        db_index=True, default=None, max_length=255, null=True
                    ),
                ),
                (
                    "short_name",
                    models.CharField(
                        db_index=True, default=None, max_length=128, null=True
                    ),
                ),
                (
                    "version",
                    models.CharField(
                        db_index=True, default=None, max_length=10, null=True
                    ),
                ),
                (
                    "type",
                    models.CharField(
                        choices=[
                            ("pipeline", "pipeline"),
                            ("notebook", "notebook"),
                            ("app", "app"),
                            ("api", "api"),
                        ],
                        db_index=True,
                        default=lnschema_core.types.TransformType["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=255, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_transforms",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "initial_version",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="lnschema_core.transform",
                    ),
                ),
                (
                    "latest_report",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="latest_report_of",
                        to="lnschema_core.file",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="lnschema_core.transform"
                    ),
                ),
                (
                    "source_file",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="source_of",
                        to="lnschema_core.file",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(models.Model, lnschema_core.models.HasParents),
        ),
        migrations.CreateModel(
            name="Storage",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True,
                        default=lnschema_core.ids.base62_8,
                        max_length=8,
                        unique=True,
                    ),
                ),
                (
                    "root",
                    models.CharField(
                        db_index=True, default=None, max_length=255, unique=True
                    ),
                ),
                ("type", models.CharField(db_index=True, max_length=30)),
                (
                    "region",
                    models.CharField(
                        db_index=True, default=None, max_length=64, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_storages",
                        to="lnschema_core.user",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Run",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True,
                        default=lnschema_core.ids.base62_20,
                        max_length=20,
                        unique=True,
                    ),
                ),
                ("run_at", models.DateTimeField(auto_now_add=True, db_index=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=255, null=True
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="created_runs",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "report",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="report_of",
                        to="lnschema_core.file",
                    ),
                ),
                (
                    "transform",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="runs",
                        to="lnschema_core.transform",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Modality",
            fields=[
                ("id", models.AutoField(primary_key=True, serialize=False)),
                (
                    "uid",
                    models.CharField(
                        db_index=True,
                        default=lnschema_core.ids.base62_8,
                        max_length=8,
                        unique=True,
                    ),
                ),
                ("name", models.CharField(db_index=True, max_length=256)),
                (
                    "ontology_id",
                    models.CharField(
                        db_index=True, default=None, max_length=32, null=True
                    ),
                ),
                (
                    "abbr",
                    models.CharField(
                        db_index=True,
                        default=None,
                        max_length=32,
                        null=True,
                        unique=True,
                    ),
                ),
                ("synonyms", models.TextField(default=None, null=True)),
                ("description", models.TextField(default=None, null=True)),
                ("molecule", models.TextField(db_index=True, default=None, null=True)),
                (
                    "instrument",
                    models.TextField(db_index=True, default=None, null=True),
                ),
                (
                    "measurement",
                    models.TextField(db_index=True, default=None, null=True),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True, db_index=True)),
                ("updated_at", models.DateTimeField(auto_now=True, db_index=True)),
                (
                    "created_by",
                    models.ForeignKey(
                        default=lnschema_core.users.current_user_id,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="created_modalities",
                        to="lnschema_core.user",
                    ),
                ),
                (
                    "parents",
                    models.ManyToManyField(
                        related_name="children", to="lnschema_core.modality"
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=(
                models.Model,
                lnschema_core.models.HasParents,
                lnschema_core.models.CanValidate,
            ),
        ),
        migrations.CreateModel(
            name="FileULabel",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.feature",
                    ),
                ),
                (
                    "file",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.file",
                    ),
                ),
                (
                    "ulabel",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.ulabel",
                    ),
                ),
            ],
            options={
                "unique_together": {("file", "ulabel")},
            },
            bases=(models.Model, lnschema_core.models.LinkORM),
        ),
        migrations.CreateModel(
            name="FileFeatureSet",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("slot", models.CharField(default=None, max_length=40, null=True)),
                (
                    "feature_set",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.featureset",
                    ),
                ),
                (
                    "file",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.file",
                    ),
                ),
            ],
            options={
                "unique_together": {("file", "feature_set")},
            },
            bases=(models.Model, lnschema_core.models.LinkORM),
        ),
        migrations.AddField(
            model_name="file",
            name="created_by",
            field=models.ForeignKey(
                default=lnschema_core.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="created_files",
                to="lnschema_core.user",
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="feature_sets",
            field=models.ManyToManyField(
                related_name="files",
                through="lnschema_core.FileFeatureSet",
                to="lnschema_core.featureset",
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="initial_version",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lnschema_core.file",
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="input_of",
            field=models.ManyToManyField(
                related_name="input_files", to="lnschema_core.run"
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="run",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_files",
                to="lnschema_core.run",
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="storage",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="files",
                to="lnschema_core.storage",
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="transform",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_files",
                to="lnschema_core.transform",
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="ulabels",
            field=models.ManyToManyField(
                related_name="files",
                through="lnschema_core.FileULabel",
                to="lnschema_core.ulabel",
            ),
        ),
        migrations.AddField(
            model_name="featureset",
            name="created_by",
            field=models.ForeignKey(
                default=lnschema_core.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="created_feature_sets",
                to="lnschema_core.user",
            ),
        ),
        migrations.AddField(
            model_name="featureset",
            name="modality",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="feature_sets",
                to="lnschema_core.modality",
            ),
        ),
        migrations.AddField(
            model_name="feature",
            name="created_by",
            field=models.ForeignKey(
                default=lnschema_core.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="created_features",
                to="lnschema_core.user",
            ),
        ),
        migrations.AddField(
            model_name="feature",
            name="feature_sets",
            field=models.ManyToManyField(
                related_name="features", to="lnschema_core.featureset"
            ),
        ),
        migrations.AddField(
            model_name="feature",
            name="modality",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="features",
                to="lnschema_core.modality",
            ),
        ),
        migrations.CreateModel(
            name="DatasetULabel",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "dataset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.dataset",
                    ),
                ),
                (
                    "feature",
                    models.ForeignKey(
                        default=None,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.feature",
                    ),
                ),
                (
                    "ulabel",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.ulabel",
                    ),
                ),
            ],
            options={
                "unique_together": {("dataset", "ulabel")},
            },
            bases=(models.Model, lnschema_core.models.LinkORM),
        ),
        migrations.CreateModel(
            name="DatasetFeatureSet",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                ("slot", models.CharField(default=None, max_length=50, null=True)),
                (
                    "dataset",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.dataset",
                    ),
                ),
                (
                    "feature_set",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="lnschema_core.featureset",
                    ),
                ),
            ],
            options={
                "unique_together": {("dataset", "feature_set")},
            },
            bases=(models.Model, lnschema_core.models.LinkORM),
        ),
        migrations.AddField(
            model_name="dataset",
            name="created_by",
            field=models.ForeignKey(
                default=lnschema_core.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="created_datasets",
                to="lnschema_core.user",
            ),
        ),
        migrations.AddField(
            model_name="dataset",
            name="feature_sets",
            field=models.ManyToManyField(
                related_name="datasets",
                through="lnschema_core.DatasetFeatureSet",
                to="lnschema_core.featureset",
            ),
        ),
        migrations.AddField(
            model_name="dataset",
            name="file",
            field=models.OneToOneField(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="dataset",
                to="lnschema_core.file",
            ),
        ),
        migrations.AddField(
            model_name="dataset",
            name="files",
            field=models.ManyToManyField(
                related_name="datasets", to="lnschema_core.file"
            ),
        ),
        migrations.AddField(
            model_name="dataset",
            name="initial_version",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                to="lnschema_core.dataset",
            ),
        ),
        migrations.AddField(
            model_name="dataset",
            name="input_of",
            field=models.ManyToManyField(
                related_name="input_datasets", to="lnschema_core.run"
            ),
        ),
        migrations.AddField(
            model_name="dataset",
            name="run",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_datasets",
                to="lnschema_core.run",
            ),
        ),
        migrations.AddField(
            model_name="dataset",
            name="storage",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="datasets",
                to="lnschema_core.storage",
            ),
        ),
        migrations.AddField(
            model_name="dataset",
            name="transform",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_datasets",
                to="lnschema_core.transform",
            ),
        ),
        migrations.AddField(
            model_name="dataset",
            name="ulabels",
            field=models.ManyToManyField(
                related_name="datasets",
                through="lnschema_core.DatasetULabel",
                to="lnschema_core.ulabel",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="file",
            unique_together={("storage", "key")},
        ),
        migrations.RemoveField(
            model_name="user",
            name="email",
        ),
        migrations.AddField(
            model_name="file",
            name="key_is_virtual",
            field=models.BooleanField(default=False),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="dataset",
            name="visibility",
            field=models.SmallIntegerField(
                choices=[(1, "Default"), (0, "Hidden"), (-1, "Trash")],
                db_index=True,
                default=1,
            ),
        ),
        migrations.AddField(
            model_name="file",
            name="visibility",
            field=models.SmallIntegerField(
                choices=[(1, "Default"), (0, "Hidden"), (-1, "Trash")],
                db_index=True,
                default=1,
            ),
        ),
        migrations.RemoveField(
            model_name="feature",
            name="modality",
        ),
        migrations.RemoveField(
            model_name="featureset",
            name="modality",
        ),
        migrations.DeleteModel(
            name="Modality",
        ),
        migrations.RenameModel(
            old_name="File",
            new_name="Artifact",
        ),
        migrations.RenameModel(
            old_name="FileFeatureSet",
            new_name="ArtifactFeatureSet",
        ),
        migrations.RenameModel(
            old_name="FileULabel",
            new_name="ArtifactULabel",
        ),
        migrations.RenameField(
            model_name="artifactfeatureset",
            old_name="file",
            new_name="artifact",
        ),
        migrations.RenameField(
            model_name="dataset",
            old_name="file",
            new_name="artifact",
        ),
        migrations.RenameField(
            model_name="dataset",
            old_name="files",
            new_name="artifacts",
        ),
        migrations.RenameField(
            model_name="ArtifactULabel",
            old_name="file",
            new_name="artifact",
        ),
        migrations.AlterUniqueTogether(
            name="artifactfeatureset",
            unique_together={("artifact", "feature_set")},
        ),
        migrations.AlterUniqueTogether(
            name="artifactulabel",
            unique_together={("artifact", "ulabel")},
        ),
        migrations.AlterField(
            model_name="artifact",
            name="created_by",
            field=models.ForeignKey(
                default=lnschema_core.users.current_user_id,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="created_artifacts",
                to="lnschema_core.user",
            ),
        ),
        migrations.AlterField(
            model_name="artifact",
            name="feature_sets",
            field=models.ManyToManyField(
                related_name="artifacts",
                through="lnschema_core.ArtifactFeatureSet",
                to="lnschema_core.featureset",
            ),
        ),
        migrations.AlterField(
            model_name="artifact",
            name="input_of",
            field=models.ManyToManyField(
                related_name="input_artifacts", to="lnschema_core.run"
            ),
        ),
        migrations.AlterField(
            model_name="artifact",
            name="run",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_artifacts",
                to="lnschema_core.run",
            ),
        ),
        migrations.AlterField(
            model_name="artifact",
            name="storage",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="artifacts",
                to="lnschema_core.storage",
            ),
        ),
        migrations.AlterField(
            model_name="artifact",
            name="transform",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="output_artifacts",
                to="lnschema_core.transform",
            ),
        ),
        migrations.AlterField(
            model_name="artifact",
            name="ulabels",
            field=models.ManyToManyField(
                related_name="artifacts",
                through="lnschema_core.ArtifactULabel",
                to="lnschema_core.ulabel",
            ),
        ),
        migrations.RenameField(
            model_name="transform",
            old_name="source_file",
            new_name="source_code",
        ),
        migrations.AlterField(
            model_name="transform",
            name="source_code",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="source_code_of",
                to="lnschema_core.artifact",
            ),
        ),
        migrations.AlterField(
            model_name="transform",
            name="latest_report",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="latest_report_of",
                to="lnschema_core.artifact",
            ),
        ),
        migrations.AlterField(
            model_name="run",
            name="report",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="report_of",
                to="lnschema_core.artifact",
            ),
        ),
        migrations.RemoveField(
            model_name="dataset",
            name="storage",
        ),
        migrations.AlterUniqueTogether(
            name="artifact",
            unique_together=set(),
        ),
        migrations.AddField(
            model_name="artifact",
            name="n_objects",
            field=models.BigIntegerField(db_index=True, default=None, null=True),
        ),
        migrations.AddField(
            model_name="artifact",
            name="n_observations",
            field=models.BigIntegerField(db_index=True, default=None, null=True),
        ),
        migrations.AddField(
            model_name="run",
            name="environment",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.PROTECT,
                related_name="environment_of",
                to="lnschema_core.artifact",
            ),
        ),
        migrations.RemoveField(
            model_name="artifact",
            name="initial_version",
        ),
        migrations.RemoveField(
            model_name="dataset",
            name="initial_version",
        ),
        migrations.RemoveField(
            model_name="transform",
            name="initial_version",
        ),
        migrations.AlterField(
            model_name="transform",
            name="uid",
            field=models.CharField(
                db_index=True, default=None, max_length=16, unique=True
            ),
        ),
        migrations.AddField(
            model_name="storage",
            name="description",
            field=models.CharField(
                db_index=True, default=None, max_length=255, null=True
            ),
        ),
        migrations.RenameModel(
            old_name="Dataset",
            new_name="Collection",
        ),
        migrations.RenameModel(
            old_name="DatasetFeatureSet",
            new_name="CollectionFeatureSet",
        ),
        migrations.RenameModel(
            old_name="DatasetULabel",
            new_name="CollectionULabel",
        ),
        migrations.RenameField(
            model_name="collectionfeatureset",
            old_name="dataset",
            new_name="collection",
        ),
        migrations.RenameField(
            model_name="collectionulabel",
            old_name="dataset",
            new_name="collection",
        ),
    ]
