# Generated by Django 4.2.23 on 2025-09-29 22:28

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("annotations", "0039_add_annotation_privacy_fields"),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name="annotation",
            name="annotation_created_by_only_one_source",
        ),
        migrations.RenameIndex(
            model_name="annotation",
            new_name="annotations_created_221e33_idx",
            old_name="annotations_created_a3e4d5_idx",
        ),
        migrations.RenameIndex(
            model_name="annotation",
            new_name="annotations_created_43bdf3_idx",
            old_name="annotations_created_b6f7g8_idx",
        ),
        migrations.AddConstraint(
            model_name="annotation",
            constraint=models.CheckConstraint(
                check=models.Q(
                    ("created_by_analysis__isnull", True),
                    ("created_by_extract__isnull", True),
                    _connector="OR",
                ),
                name="annotation_created_by_only_one_source",
                violation_error_message="An annotation cannot be created by both an analysis and an extract",
            ),
        ),
    ]
