diff --git a/alyx/experiments/migrations/0013_remove_trajectoryestimate_unique_trajectory_per_provenance_and_more.py b/alyx/experiments/migrations/0013_remove_trajectoryestimate_unique_trajectory_per_provenance_and_more.py new file mode 100644 index 00000000..5afa678f --- /dev/null +++ b/alyx/experiments/migrations/0013_remove_trajectoryestimate_unique_trajectory_per_provenance_and_more.py @@ -0,0 +1,25 @@ +# Generated by Django 4.2.11 on 2024-03-22 12:45 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('experiments', '0012_fov_imagingstack_imagingtype_alter_channel_lateral_and_more'), + ] + + operations = [ + migrations.RemoveConstraint( + model_name='trajectoryestimate', + name='unique_trajectory_per_provenance', + ), + migrations.AddConstraint( + model_name='trajectoryestimate', + constraint=models.UniqueConstraint(condition=models.Q(('probe_insertion__isnull', True)), fields=('provenance', 'chronic_insertion'), name='unique_trajectory_per_chronic_provenance'), + ), + migrations.AddConstraint( + model_name='trajectoryestimate', + constraint=models.UniqueConstraint(condition=models.Q(('probe_insertion__isnull', False)), fields=('provenance', 'probe_insertion'), name='unique_trajectory_per_provenance'), + ), + ]