# Generated by Django 3.0.8 on 2020-07-20 15:27

import django.db.models.deletion
from django.db import migrations, models

import isc_common.fields.related


class Migration(migrations.Migration):
    dependencies = [
        ('production', '0285_auto_20200720_1525'),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name='launch_operation_resources',
            name='Launch_operation_resources_unique_constraint_0',
        ),
        migrations.RemoveConstraint(
            model_name='launch_operation_resources',
            name='Launch_operation_resources_unique_constraint_1',
        ),
        migrations.RemoveConstraint(
            model_name='launch_operation_resources',
            name='Launch_operation_resources_unique_constraint_2',
        ),
        migrations.RemoveConstraint(
            model_name='launch_operation_resources',
            name='Launch_operation_resources_unique_constraint_3',
        ),
        migrations.RemoveConstraint(
            model_name='launch_operation_resources',
            name='Launch_operation_resources_unique_constraint_4',
        ),
        migrations.RemoveConstraint(
            model_name='launch_operation_resources',
            name='Launch_operation_resources_unique_constraint_5',
        ),
        migrations.RemoveConstraint(
            model_name='launch_operation_resources',
            name='Launch_operation_resources_unique_constraint_6',
        ),
        migrations.RemoveConstraint(
            model_name='launch_operation_resources',
            name='Launch_operation_resources_unique_constraint_7',
        ),
        migrations.AlterField(
            model_name='launch_operation_resources',
            name='resource',
            field=isc_common.fields.related.ForeignKeyProtect(on_delete=django.db.models.deletion.PROTECT, to='production.Resource'),
        ),
        migrations.AddConstraint(
            model_name='launch_operation_resources',
            constraint=models.UniqueConstraint(condition=models.Q(location_fin=None), fields=('launch_operationitem', 'location', 'resource'), name='Launch_operation_resources_unique_constraint_0'),
        ),
        migrations.AddConstraint(
            model_name='launch_operation_resources',
            constraint=models.UniqueConstraint(fields=('launch_operationitem', 'location', 'location_fin', 'resource'), name='Launch_operation_resources_unique_constraint_1'),
        ),
    ]
