# Generated by Django 5.2.13 on 2026-04-25 10:37

import apps.core.storage.paths
import django.db.models.deletion
import django.utils.timezone
import django_fsm
import uuid
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="ChallengeScoringRubric",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("description", models.TextField(blank=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name="ChallengeRubricSection",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("title", models.CharField(max_length=255)),
                ("instructions", models.TextField(blank=True)),
                (
                    "weight",
                    models.DecimalField(
                        decimal_places=4,
                        default=Decimal("0.25"),
                        help_text="Fractional weight (sections must sum to 1.0).",
                        max_digits=5,
                    ),
                ),
                ("max_marks", models.PositiveSmallIntegerField(default=10)),
                ("order", models.PositiveSmallIntegerField(default=0)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "rubric",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sections",
                        to="smehub_showcasing.challengescoringrubric",
                    ),
                ),
            ],
            options={
                "ordering": ["order", "id"],
            },
        ),
        migrations.CreateModel(
            name="DealRoom",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("room_id", models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ("counterparty_object_id", models.CharField(max_length=64)),
                ("origin_object_id", models.CharField(blank=True, max_length=64)),
                ("title", models.CharField(blank=True, max_length=255)),
                ("summary", models.TextField(blank=True)),
                (
                    "status",
                    django_fsm.FSMField(
                        choices=[
                            ("open", "Open"),
                            ("expired", "Expired"),
                            ("agreement_reached", "Agreement reached"),
                            ("closed", "Closed"),
                        ],
                        db_index=True,
                        default="open",
                        max_length=24,
                        protected=True,
                    ),
                ),
                ("opened_at", models.DateTimeField(default=django.utils.timezone.now)),
                (
                    "expiry_date",
                    models.DateTimeField(
                        help_text="Auto-expiry deadline (FRSME-ISD016 — Celery beat)."
                    ),
                ),
                ("closed_at", models.DateTimeField(blank=True, null=True)),
                ("closed_reason", models.TextField(blank=True)),
                ("last_activity_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "business",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="smehub_deal_rooms",
                        to="smehub_onboarding.business",
                    ),
                ),
                (
                    "counterparty_content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "entrepreneur",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="smehub_deal_rooms",
                        to="smehub_onboarding.entrepreneurprofile",
                    ),
                ),
                (
                    "origin_content_type",
                    models.ForeignKey(
                        blank=True,
                        help_text="Optional — the ShowcaseEvent / Challenge / Connection that triggered this room.",
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "ordering": ["-last_activity_at"],
            },
        ),
        migrations.CreateModel(
            name="DealAgreement",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("title", models.CharField(max_length=255)),
                ("summary", models.TextField(blank=True)),
                (
                    "signed_file",
                    models.FileField(upload_to=apps.core.storage.paths.upload_to_smehub_showcasing),
                ),
                ("agreed_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("notes", models.TextField(blank=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "formalised_by_admin",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "deal_room",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="agreement",
                        to="smehub_showcasing.dealroom",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="DealRoomDocument",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("label", models.CharField(max_length=255)),
                (
                    "kind",
                    models.CharField(
                        choices=[
                            ("proposal", "Proposal"),
                            ("term_sheet", "Term sheet"),
                            ("due_diligence", "Due diligence"),
                            ("other", "Other"),
                        ],
                        db_index=True,
                        default="other",
                        max_length=24,
                    ),
                ),
                (
                    "file",
                    models.FileField(upload_to=apps.core.storage.paths.upload_to_smehub_showcasing),
                ),
                ("version", models.PositiveSmallIntegerField(default=1)),
                ("notes", models.TextField(blank=True)),
                ("uploaded_at", models.DateTimeField(auto_now_add=True)),
                (
                    "deal_room",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="documents",
                        to="smehub_showcasing.dealroom",
                    ),
                ),
                (
                    "uploaded_by",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-uploaded_at"],
            },
        ),
        migrations.CreateModel(
            name="DealRoomMessage",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("body", models.TextField()),
                (
                    "attachment",
                    models.FileField(
                        blank=True,
                        null=True,
                        upload_to=apps.core.storage.paths.upload_to_smehub_showcasing,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "author",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "deal_room",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="messages",
                        to="smehub_showcasing.dealroom",
                    ),
                ),
                (
                    "parent",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="replies",
                        to="smehub_showcasing.dealroommessage",
                    ),
                ),
            ],
            options={
                "ordering": ["created_at"],
            },
        ),
        migrations.CreateModel(
            name="InnovationCatalogueEntry",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("title", models.CharField(max_length=255)),
                ("summary", models.TextField(blank=True)),
                ("description", models.TextField(blank=True)),
                ("sectors", models.JSONField(blank=True, default=list)),
                ("impact_metrics", models.JSONField(blank=True, default=dict)),
                (
                    "cover_image",
                    models.FileField(
                        blank=True,
                        null=True,
                        upload_to=apps.core.storage.paths.upload_to_smehub_showcasing,
                    ),
                ),
                (
                    "pitch_deck",
                    models.FileField(
                        blank=True,
                        null=True,
                        upload_to=apps.core.storage.paths.upload_to_smehub_showcasing,
                    ),
                ),
                ("video_link", models.URLField(blank=True)),
                ("website", models.URLField(blank=True)),
                (
                    "visibility",
                    models.CharField(
                        choices=[
                            ("public", "Public — visible to all logged-in stakeholders"),
                            ("stakeholder", "Stakeholder — investors / partners / buyers only"),
                            ("private", "Private — admin only"),
                        ],
                        db_index=True,
                        default="stakeholder",
                        max_length=16,
                    ),
                ),
                ("is_active", models.BooleanField(default=True)),
                ("version", models.PositiveSmallIntegerField(default=1)),
                ("published_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "business",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="smehub_catalogue_entries",
                        to="smehub_onboarding.business",
                    ),
                ),
                (
                    "entrepreneur",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="smehub_catalogue_entries",
                        to="smehub_onboarding.entrepreneurprofile",
                    ),
                ),
                (
                    "last_updated_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "Innovation catalogue entries",
                "ordering": ["-published_at"],
            },
        ),
        migrations.CreateModel(
            name="InnovationCatalogueVersion",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("version", models.PositiveSmallIntegerField()),
                ("title", models.CharField(max_length=255)),
                ("summary", models.TextField(blank=True)),
                ("description", models.TextField(blank=True)),
                ("sectors", models.JSONField(blank=True, default=list)),
                ("impact_metrics", models.JSONField(blank=True, default=dict)),
                (
                    "cover_image",
                    models.FileField(
                        blank=True,
                        null=True,
                        upload_to=apps.core.storage.paths.upload_to_smehub_showcasing,
                    ),
                ),
                (
                    "pitch_deck",
                    models.FileField(
                        blank=True,
                        null=True,
                        upload_to=apps.core.storage.paths.upload_to_smehub_showcasing,
                    ),
                ),
                ("video_link", models.URLField(blank=True)),
                ("website", models.URLField(blank=True)),
                ("notes", models.TextField(blank=True)),
                ("captured_at", models.DateTimeField(auto_now_add=True)),
                (
                    "captured_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "entry",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="versions",
                        to="smehub_showcasing.innovationcatalogueentry",
                    ),
                ),
            ],
            options={
                "ordering": ["-version"],
            },
        ),
        migrations.CreateModel(
            name="InnovationChallenge",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("title", models.CharField(max_length=255)),
                ("summary", models.TextField(blank=True)),
                ("description", models.TextField(blank=True)),
                ("theme", models.CharField(blank=True, max_length=255)),
                ("target_sectors", models.JSONField(blank=True, default=list)),
                ("eligibility", models.JSONField(blank=True, default=dict)),
                ("prize_summary", models.TextField(blank=True)),
                ("application_deadline", models.DateTimeField()),
                ("judging_deadline", models.DateTimeField(blank=True, null=True)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("draft", "Draft"),
                            ("open", "Open"),
                            ("judging", "Judging"),
                            ("announced", "Winners announced"),
                            ("closed", "Closed"),
                        ],
                        db_index=True,
                        default="draft",
                        max_length=16,
                    ),
                ),
                (
                    "cover_image",
                    models.FileField(
                        blank=True,
                        null=True,
                        upload_to=apps.core.storage.paths.upload_to_smehub_showcasing,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("published_at", models.DateTimeField(blank=True, null=True)),
                ("announced_at", models.DateTimeField(blank=True, null=True)),
                (
                    "organiser",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="smehub_challenges_organised",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-application_deadline"],
            },
        ),
        migrations.AddField(
            model_name="challengescoringrubric",
            name="challenge",
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="rubric",
                to="smehub_showcasing.innovationchallenge",
            ),
        ),
        migrations.CreateModel(
            name="ShowcaseApplication",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("target_object_id", models.CharField(max_length=64)),
                ("application_id", models.CharField(editable=False, max_length=20, unique=True)),
                ("innovation_title", models.CharField(max_length=255)),
                ("innovation_description", models.TextField(blank=True)),
                ("problem_statement", models.TextField(blank=True)),
                ("solution_summary", models.TextField(blank=True)),
                ("impact_potential", models.TextField(blank=True)),
                (
                    "pitch_deck",
                    models.FileField(
                        blank=True,
                        null=True,
                        upload_to=apps.core.storage.paths.upload_to_smehub_showcasing,
                    ),
                ),
                ("pitch_video_link", models.URLField(blank=True)),
                ("supporting_link", models.URLField(blank=True)),
                (
                    "status",
                    django_fsm.FSMField(
                        choices=[
                            ("submitted", "Submitted"),
                            ("under_review", "Under review"),
                            ("confirmed", "Confirmed"),
                            ("rejected", "Rejected"),
                            ("withdrawn", "Withdrawn"),
                        ],
                        db_index=True,
                        default="submitted",
                        max_length=16,
                        protected=True,
                    ),
                ),
                ("submitted_at", models.DateTimeField(default=django.utils.timezone.now)),
                ("decided_at", models.DateTimeField(blank=True, null=True)),
                ("decision_note", models.TextField(blank=True)),
                (
                    "weighted_score",
                    models.DecimalField(blank=True, decimal_places=2, max_digits=6, null=True),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "business",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="smehub_showcase_applications",
                        to="smehub_onboarding.business",
                    ),
                ),
                (
                    "decision_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "entrepreneur",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="smehub_showcase_applications",
                        to="smehub_onboarding.entrepreneurprofile",
                    ),
                ),
                (
                    "target_content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
            ],
            options={
                "ordering": ["-created_at"],
            },
        ),
        migrations.CreateModel(
            name="PitchScore",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("score", models.DecimalField(decimal_places=2, max_digits=5)),
                ("comments", models.TextField(blank=True)),
                ("submitted_at", models.DateTimeField(default=django.utils.timezone.now)),
                (
                    "judge",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="smehub_pitch_scores",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "section",
                    models.ForeignKey(
                        blank=True,
                        help_text="Required for challenge applications; null for event composite scores.",
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="pitch_scores",
                        to="smehub_showcasing.challengerubricsection",
                    ),
                ),
                (
                    "application",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="pitch_scores",
                        to="smehub_showcasing.showcaseapplication",
                    ),
                ),
            ],
            options={
                "ordering": ["-submitted_at"],
            },
        ),
        migrations.AddField(
            model_name="innovationcatalogueentry",
            name="application",
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="catalogue_entry",
                to="smehub_showcasing.showcaseapplication",
            ),
        ),
        migrations.CreateModel(
            name="ShowcaseEvent",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                ("summary", models.TextField(blank=True)),
                ("description", models.TextField(blank=True)),
                (
                    "format",
                    models.CharField(
                        choices=[
                            ("virtual", "Virtual"),
                            ("physical", "Physical"),
                            ("hybrid", "Hybrid"),
                        ],
                        default="virtual",
                        max_length=16,
                    ),
                ),
                ("starts_at", models.DateTimeField()),
                ("ends_at", models.DateTimeField()),
                ("application_deadline", models.DateTimeField(blank=True, null=True)),
                (
                    "target_sectors",
                    models.JSONField(
                        blank=True,
                        default=list,
                        help_text="Sector tags (matches BUSINESS choices); FRSME-ISD002 facet.",
                    ),
                ),
                (
                    "eligibility",
                    models.JSONField(
                        blank=True,
                        default=dict,
                        help_text="Free-form eligibility payload (stages, geography, programmes).",
                    ),
                ),
                ("venue", models.CharField(blank=True, max_length=255)),
                (
                    "video_link",
                    models.URLField(
                        blank=True, help_text="Livestream / recording URL (FRSME-ISD011)."
                    ),
                ),
                (
                    "cover_image",
                    models.FileField(
                        blank=True,
                        null=True,
                        upload_to=apps.core.storage.paths.upload_to_smehub_showcasing,
                    ),
                ),
                (
                    "status",
                    django_fsm.FSMField(
                        choices=[
                            ("draft", "Draft"),
                            ("published", "Published"),
                            ("live", "Live"),
                            ("concluded", "Concluded"),
                        ],
                        db_index=True,
                        default="draft",
                        max_length=16,
                        protected=True,
                    ),
                ),
                ("published_at", models.DateTimeField(blank=True, null=True)),
                ("concluded_at", models.DateTimeField(blank=True, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "evaluation_panel",
                    models.ManyToManyField(
                        blank=True,
                        help_text="Users with the JUDGE role assigned to evaluate pitches.",
                        related_name="smehub_showcase_panels",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "organiser",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="smehub_showcases_organised",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-starts_at"],
            },
        ),
        migrations.CreateModel(
            name="EventAttendance",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("attended", models.BooleanField(default=False)),
                ("checked_in_at", models.DateTimeField(blank=True, null=True)),
                ("notes", models.TextField(blank=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "checked_in_by",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "participant",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "application",
                    models.ForeignKey(
                        blank=True,
                        help_text="Optional — link to the participant's application row.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="attendance_records",
                        to="smehub_showcasing.showcaseapplication",
                    ),
                ),
                (
                    "event",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="attendance_records",
                        to="smehub_showcasing.showcaseevent",
                    ),
                ),
            ],
            options={
                "ordering": ["event", "participant"],
            },
        ),
        migrations.AddIndex(
            model_name="dealroom",
            index=models.Index(
                fields=["entrepreneur", "status"], name="smehub_show_entrepr_01050f_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="dealroom",
            index=models.Index(
                fields=["counterparty_content_type", "counterparty_object_id", "status"],
                name="smehub_show_counter_967cc0_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="dealroom",
            index=models.Index(
                fields=["status", "expiry_date"], name="smehub_show_status_d2b749_idx"
            ),
        ),
        migrations.AddConstraint(
            model_name="dealroom",
            constraint=models.UniqueConstraint(
                condition=models.Q(("status", "open")),
                fields=("business", "counterparty_content_type", "counterparty_object_id"),
                name="uniq_smehub_open_deal_room_per_pair",
            ),
        ),
        migrations.AddConstraint(
            model_name="dealroomdocument",
            constraint=models.UniqueConstraint(
                fields=("deal_room", "label", "version"), name="uniq_smehub_deal_room_doc_version"
            ),
        ),
        migrations.AddIndex(
            model_name="dealroommessage",
            index=models.Index(
                fields=["deal_room", "created_at"], name="smehub_show_deal_ro_6bb22e_idx"
            ),
        ),
        migrations.AddConstraint(
            model_name="innovationcatalogueversion",
            constraint=models.UniqueConstraint(
                fields=("entry", "version"), name="uniq_smehub_catalogue_version"
            ),
        ),
        migrations.AddIndex(
            model_name="innovationchallenge",
            index=models.Index(
                fields=["status", "application_deadline"], name="smehub_show_status_cc5dab_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="showcaseapplication",
            index=models.Index(
                fields=["target_content_type", "target_object_id", "status"],
                name="smehub_show_target__7371dd_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="showcaseapplication",
            index=models.Index(
                fields=["entrepreneur", "status"], name="smehub_show_entrepr_a98eb9_idx"
            ),
        ),
        migrations.AddConstraint(
            model_name="showcaseapplication",
            constraint=models.UniqueConstraint(
                condition=models.Q(("status__in", ["submitted", "under_review", "confirmed"])),
                fields=("entrepreneur", "target_content_type", "target_object_id"),
                name="uniq_smehub_active_showcase_application",
            ),
        ),
        migrations.AddConstraint(
            model_name="pitchscore",
            constraint=models.UniqueConstraint(
                fields=("application", "judge", "section"), name="uniq_smehub_pitch_score_section"
            ),
        ),
        migrations.AddIndex(
            model_name="showcaseevent",
            index=models.Index(
                fields=["status", "starts_at"], name="smehub_show_status_b6cfc0_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="eventattendance",
            index=models.Index(fields=["event", "attended"], name="smehub_show_event_i_4e9009_idx"),
        ),
        migrations.AddConstraint(
            model_name="eventattendance",
            constraint=models.UniqueConstraint(
                fields=("event", "participant"), name="uniq_smehub_event_attendance"
            ),
        ),
    ]
