# Generated by Django 5.2.9 on 2026-02-04 13:53

import django.contrib.postgres.constraints
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('io', '0009_alter_importedobjectproviderrelationship_unique_together_and_more'),
        ('wbfdm', '0038_remove_instrumentlistthroughmodel_from_date_and_more'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='instrumentlistthroughmodel',
            name='unique_instrument_per_list',
        ),
        migrations.RemoveConstraint(
            model_name='instrumentlistthroughmodel',
            name='exclude_overlapping_instrument_list',
        ),
        migrations.AddField(
            model_name='instrumentlist',
            name='constituent_loader_path',
            field=models.CharField(blank=True, help_text='If set, load the Instrument queryset returned by this function and set them as the new instrument list constituent', max_length=512, null=True),
        ),
        migrations.AddConstraint(
            model_name='instrumentlistthroughmodel',
            constraint=django.contrib.postgres.constraints.ExclusionConstraint(condition=models.Q(('instrument__isnull', False)), expressions=[('timespan', '&&'), ('instrument', '='), ('instrument_list', '=')], name='exclude_overlapping_instrument_list'),
        ),
        migrations.AddField(
            model_name='instrumentlist',
            name='constituent_loader_kwargs',
            field=models.JSONField(default=dict),
        ),
    ]
