# 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 = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("contenttypes", "0002_remove_content_type_name"),
        ("catalog", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="item",
            name="last_editor",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AddField(
            model_name="item",
            name="merged_to_item",
            field=models.ForeignKey(
                default=None,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="merged_from_items",
                to="catalog.item",
            ),
        ),
        migrations.AddField(
            model_name="item",
            name="polymorphic_ctype",
            field=models.ForeignKey(
                editable=False,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="polymorphic_catalog.item_set+",
                to="contenttypes.contenttype",
            ),
        ),
        migrations.AddField(
            model_name="externalresource",
            name="item",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="external_resources",
                to="catalog.item",
            ),
        ),
        migrations.CreateModel(
            name="Performance",
            fields=[],
            options={
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("catalog.item",),
        ),
        migrations.CreateModel(
            name="Series",
            fields=[],
            options={
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("catalog.item",),
        ),
        migrations.AddField(
            model_name="work",
            name="editions",
            field=models.ManyToManyField(related_name="works", to="catalog.Edition"),
        ),
        migrations.AddField(
            model_name="tvseason",
            name="show",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="seasons",
                to="catalog.tvshow",
            ),
        ),
        migrations.AddField(
            model_name="tvepisode",
            name="season",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="episodes",
                to="catalog.tvseason",
            ),
        ),
        migrations.AddField(
            model_name="tvepisode",
            name="show",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="episodes",
                to="catalog.tvshow",
            ),
        ),
        migrations.AlterUniqueTogether(
            name="itemlookupid",
            unique_together={("id_type", "id_value")},
        ),
        migrations.AlterIndexTogether(
            name="item",
            index_together={("primary_lookup_id_type", "primary_lookup_id_value")},
        ),
        migrations.AlterUniqueTogether(
            name="externalresource",
            unique_together={("id_type", "id_value")},
        ),
    ]
