# Generated by Django 4.2.13 on 2024-06-08 19:21

import uuid

import django.core.validators
import django.db.models.deletion
import django.utils.timezone
import markdownx.models
from django.db import migrations, models

import catalog.common.utils
import journal.models.mixins


class Migration(migrations.Migration):
    """
    This migration is a combination of all the migrations til 0.10.0
    """

    replaces = [
        ("journal", "0001_initial"),
        ("journal", "0002_initial"),
        ("journal", "0003_auto_20230113_0506"),
        ("journal", "0004_alter_shelflogentry_timestamp"),
        ("journal", "0005_auto_20230114_1134"),
        ("journal", "0006_auto_20230114_2139"),
        ("journal", "0007_alter_collection_catalog_item"),
        ("journal", "0008_alter_shelfmember_unique_together"),
        ("journal", "0009_comment_focus_item"),
        ("journal", "0010_shelfmember_journal_she_parent__9da946_idx"),
        ("journal", "0011_performance"),
        ("journal", "0012_alter_piece_polymorphic_ctype_alter_shelf_items"),
        ("journal", "0013_remove_comment_focus_item"),
        (
            "journal",
            "0014_remove_reply_piece_ptr_remove_reply_reply_to_content_and_more",
        ),
        ("journal", "0015_use_identity_support_remote_piece"),
        ("journal", "0016_piecepost_piece_posts_piecepost_unique_piece_post"),
        ("journal", "0017_alter_piece_options_and_more"),
        ("journal", "0018_shelflogentrypost_shelflogentry_posts_and_more"),
        ("journal", "0019_alter_collection_edited_time_and_more"),
        ("journal", "0020_shelflogentry_unique_shelf_log_entry"),
        ("journal", "0021_pieceinteraction_pieceinteraction_unique_interaction"),
        ("journal", "0022_letterboxdimporter"),
        ("journal", "0023_debris"),
        ("journal", "0024_i18n"),
        ("journal", "0025_pin_tags"),
        ("journal", "0026_pinned_tag_index"),
    ]
    initial = True

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        ("users", "0001_initial_0_10"),
        ("catalog", "0001_initial_0_10"),
        ("takahe", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="Piece",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "uid",
                    models.UUIDField(db_index=True, default=uuid.uuid4, editable=False),
                ),
                ("local", models.BooleanField(default=True)),
                (
                    "polymorphic_ctype",
                    models.ForeignKey(
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="polymorphic_%(app_label)s.%(class)s_set+",
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "abstract": False,
                "base_manager_name": "objects",
            },
            bases=(models.Model, journal.models.mixins.UserOwnedObjectMixin),
        ),
        migrations.CreateModel(
            name="ShelfLogEntry",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "shelf_type",
                    models.CharField(
                        choices=[
                            ("wishlist", "WISHLIST"),
                            ("progress", "PROGRESS"),
                            ("complete", "COMPLETE"),
                            ("dropped", "DROPPED"),
                        ],
                        max_length=100,
                        null=True,
                    ),
                ),
                ("timestamp", models.DateTimeField()),
                ("created_time", models.DateTimeField(auto_now_add=True)),
                ("edited_time", models.DateTimeField(auto_now=True)),
                (
                    "item",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
                    ),
                ),
                (
                    "owner",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="users.apidentity",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="LetterboxdImporter",
            fields=[],
            options={
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("users.task",),
        ),
        migrations.CreateModel(
            name="Collection",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                (
                    "title",
                    models.CharField(default="", max_length=1000, verbose_name="title"),
                ),
                (
                    "brief",
                    models.TextField(
                        blank=True, default="", verbose_name="description"
                    ),
                ),
                (
                    "cover",
                    models.ImageField(
                        blank=True,
                        default="item/default.svg",
                        upload_to=catalog.common.utils.piece_cover_path,
                    ),
                ),
                ("collaborative", models.PositiveSmallIntegerField(default=0)),
            ],
            options={
                "abstract": False,
            },
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="CollectionMember",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                ("position", models.PositiveIntegerField()),
            ],
            options={
                "abstract": False,
            },
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="Comment",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                (
                    "remote_id",
                    models.CharField(default=None, max_length=200, null=True),
                ),
                ("text", models.TextField()),
            ],
            options={
                "abstract": False,
            },
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="Debris",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                (
                    "remote_id",
                    models.CharField(default=None, max_length=200, null=True),
                ),
                ("class_name", models.CharField(max_length=50)),
            ],
            options={
                "abstract": False,
            },
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="FeaturedCollection",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                ("created_time", models.DateTimeField(auto_now_add=True)),
                ("edited_time", models.DateTimeField(auto_now=True)),
            ],
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="Like",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
            ],
            options={
                "abstract": False,
                "base_manager_name": "objects",
            },
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="Rating",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                (
                    "remote_id",
                    models.CharField(default=None, max_length=200, null=True),
                ),
                (
                    "grade",
                    models.PositiveSmallIntegerField(
                        default=0,
                        null=True,
                        validators=[
                            django.core.validators.MaxValueValidator(10),
                            django.core.validators.MinValueValidator(1),
                        ],
                    ),
                ),
            ],
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="Review",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                (
                    "remote_id",
                    models.CharField(default=None, max_length=200, null=True),
                ),
                ("title", models.CharField(max_length=500)),
                ("body", markdownx.models.MarkdownxField()),
            ],
            options={
                "abstract": False,
            },
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="Shelf",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                (
                    "shelf_type",
                    models.CharField(
                        choices=[
                            ("wishlist", "WISHLIST"),
                            ("progress", "PROGRESS"),
                            ("complete", "COMPLETE"),
                            ("dropped", "DROPPED"),
                        ],
                        max_length=100,
                    ),
                ),
            ],
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="Tag",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                (
                    "title",
                    models.CharField(
                        max_length=100,
                        validators=[
                            django.core.validators.RegexValidator(
                                inverse_match=True, regex="\\s+"
                            )
                        ],
                    ),
                ),
                ("pinned", models.BooleanField(default=False, null=True)),
            ],
            bases=("journal.piece",),
        ),
        migrations.CreateModel(
            name="ShelfLogEntryPost",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "log_entry",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="journal.shelflogentry",
                    ),
                ),
                (
                    "post",
                    models.ForeignKey(
                        db_constraint=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="takahe.post",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="shelflogentry",
            name="posts",
            field=models.ManyToManyField(
                related_name="log_entries",
                through="journal.ShelfLogEntryPost",
                to="takahe.post",
            ),
        ),
        migrations.CreateModel(
            name="PiecePost",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "piece",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="journal.piece"
                    ),
                ),
                (
                    "post",
                    models.ForeignKey(
                        db_constraint=False,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="takahe.post",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="PieceInteraction",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("target_type", models.CharField(max_length=50)),
                ("interaction_type", models.CharField(max_length=50)),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                (
                    "identity",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="interactions",
                        to="users.apidentity",
                    ),
                ),
                (
                    "target",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="interactions",
                        to="journal.piece",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="piece",
            name="posts",
            field=models.ManyToManyField(
                related_name="pieces", through="journal.PiecePost", to="takahe.post"
            ),
        ),
        migrations.CreateModel(
            name="TagMember",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                ("position", models.PositiveIntegerField()),
                (
                    "item",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
                    ),
                ),
                (
                    "owner",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="users.apidentity",
                    ),
                ),
                (
                    "parent",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="members",
                        to="journal.tag",
                    ),
                ),
            ],
            bases=("journal.piece",),
        ),
        migrations.AddField(
            model_name="tag",
            name="items",
            field=models.ManyToManyField(
                through="journal.TagMember", to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="tag",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="users.apidentity"
            ),
        ),
        migrations.CreateModel(
            name="ShelfMember",
            fields=[
                (
                    "piece_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="journal.piece",
                    ),
                ),
                (
                    "visibility",
                    models.PositiveSmallIntegerField(
                        choices=[
                            (0, "Public"),
                            (1, "Followers Only"),
                            (2, "Mentioned Only"),
                        ],
                        default=0,
                    ),
                ),
                (
                    "created_time",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("edited_time", models.DateTimeField(auto_now=True)),
                ("metadata", models.JSONField(default=dict)),
                ("position", models.PositiveIntegerField()),
                (
                    "item",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
                    ),
                ),
                (
                    "owner",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to="users.apidentity",
                    ),
                ),
                (
                    "parent",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="members",
                        to="journal.shelf",
                    ),
                ),
            ],
            bases=("journal.piece",),
        ),
        migrations.AddConstraint(
            model_name="shelflogentrypost",
            constraint=models.UniqueConstraint(
                fields=("log_entry", "post"), name="unique_log_entry_post"
            ),
        ),
        migrations.AddConstraint(
            model_name="shelflogentry",
            constraint=models.UniqueConstraint(
                fields=("owner", "item", "timestamp", "shelf_type"),
                name="unique_shelf_log_entry",
            ),
        ),
        migrations.AddField(
            model_name="shelf",
            name="items",
            field=models.ManyToManyField(
                related_name="+", through="journal.ShelfMember", to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="shelf",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="users.apidentity"
            ),
        ),
        migrations.AddField(
            model_name="review",
            name="item",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="review",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="users.apidentity"
            ),
        ),
        migrations.AddField(
            model_name="rating",
            name="item",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="rating",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="users.apidentity"
            ),
        ),
        migrations.AddConstraint(
            model_name="piecepost",
            constraint=models.UniqueConstraint(
                fields=("piece", "post"), name="unique_piece_post"
            ),
        ),
        migrations.AddIndex(
            model_name="pieceinteraction",
            index=models.Index(
                fields=["identity", "interaction_type", "created_time"],
                name="journal_pie_identit_bd12d3_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="pieceinteraction",
            index=models.Index(
                fields=["target", "interaction_type", "created_time"],
                name="journal_pie_target__f943ca_idx",
            ),
        ),
        migrations.AddConstraint(
            model_name="pieceinteraction",
            constraint=models.UniqueConstraint(
                fields=("identity", "interaction_type", "target"),
                name="unique_interaction",
            ),
        ),
        migrations.AddField(
            model_name="like",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="users.apidentity"
            ),
        ),
        migrations.AddField(
            model_name="like",
            name="target",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="likes",
                to="journal.piece",
            ),
        ),
        migrations.AddField(
            model_name="featuredcollection",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="users.apidentity"
            ),
        ),
        migrations.AddField(
            model_name="featuredcollection",
            name="target",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="journal.collection"
            ),
        ),
        migrations.AddField(
            model_name="debris",
            name="item",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="debris",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="users.apidentity"
            ),
        ),
        migrations.AddField(
            model_name="comment",
            name="item",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="comment",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="users.apidentity"
            ),
        ),
        migrations.AddField(
            model_name="collectionmember",
            name="item",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="collectionmember",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="users.apidentity"
            ),
        ),
        migrations.AddField(
            model_name="collectionmember",
            name="parent",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="members",
                to="journal.collection",
            ),
        ),
        migrations.AddField(
            model_name="collection",
            name="catalog_item",
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="journal_item",
                to="catalog.collection",
            ),
        ),
        migrations.AddField(
            model_name="collection",
            name="featured_by",
            field=models.ManyToManyField(
                related_name="featured_collections",
                through="journal.FeaturedCollection",
                to="users.apidentity",
            ),
        ),
        migrations.AddField(
            model_name="collection",
            name="items",
            field=models.ManyToManyField(
                related_name="collections",
                through="journal.CollectionMember",
                to="catalog.item",
            ),
        ),
        migrations.AddField(
            model_name="collection",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="users.apidentity"
            ),
        ),
        migrations.AlterUniqueTogether(
            name="tagmember",
            unique_together={("parent", "item")},
        ),
        migrations.AddIndex(
            model_name="tag",
            index=models.Index(
                fields=["owner", "pinned"], name="journal_tag_owner_i_068598_idx"
            ),
        ),
        migrations.AlterUniqueTogether(
            name="tag",
            unique_together={("owner", "title")},
        ),
        migrations.AddIndex(
            model_name="shelfmember",
            index=models.Index(
                fields=["parent_id", "visibility", "created_time"],
                name="journal_she_parent__9da946_idx",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="shelfmember",
            unique_together={("owner", "item")},
        ),
        migrations.AlterUniqueTogether(
            name="shelf",
            unique_together={("owner", "shelf_type")},
        ),
        migrations.AlterUniqueTogether(
            name="rating",
            unique_together={("owner", "item")},
        ),
        migrations.AlterUniqueTogether(
            name="featuredcollection",
            unique_together={("owner", "target")},
        ),
    ]
