# Generated by Django 3.2.16 on 2023-01-12 01:32

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


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("journal", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("contenttypes", "0002_remove_content_type_name"),
        ("catalog", "0002_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="shelflogentry",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="piece",
            name="polymorphic_ctype",
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="polymorphic_journal.piece_set+",
                to="contenttypes.contenttype",
            ),
        ),
        migrations.AddField(
            model_name="tagmember",
            name="item",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="tagmember",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="tagmember",
            name="parent",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="members",
                to="journal.tag",
            ),
        ),
        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=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="shelfmember",
            name="item",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="shelfmember",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="shelfmember",
            name="parent",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="members",
                to="journal.shelf",
            ),
        ),
        migrations.AddField(
            model_name="shelf",
            name="items",
            field=models.ManyToManyField(
                related_name="_journal_shelf_items_+",
                through="journal.ShelfMember",
                to="catalog.Item",
            ),
        ),
        migrations.AddField(
            model_name="shelf",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL
            ),
        ),
        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=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="reply",
            name="reply_to_content",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="replies",
                to="journal.piece",
            ),
        ),
        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=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="memo",
            name="item",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to="catalog.item"
            ),
        ),
        migrations.AddField(
            model_name="memo",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AddField(
            model_name="like",
            name="owner",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL
            ),
        ),
        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="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=settings.AUTH_USER_MODEL
            ),
        ),
        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=settings.AUTH_USER_MODEL
            ),
        ),
        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, to="catalog.collection"
            ),
        ),
        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=settings.AUTH_USER_MODEL
            ),
        ),
        migrations.AlterUniqueTogether(
            name="tag",
            unique_together={("owner", "title")},
        ),
        migrations.AlterUniqueTogether(
            name="shelf",
            unique_together={("owner", "shelf_type")},
        ),
    ]
