# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

    constraint_args = {
        'table': 'trainings_trainingactivity',
        'constraint': 'trainings_trainingactivity_sort_order_training_id_key',
    }

    dependencies = [
        ('trainings', '0022_activities_unique_together_sort_order_training'),
    ]

    operations = [
        migrations.AlterUniqueTogether(
            name='trainingactivity',
            unique_together=set([]),
        ),
        migrations.RunSQL(
            'ALTER TABLE %(table)s ADD CONSTRAINT "%(constraint)s" '
            'UNIQUE (sort_order, training_id) DEFERRABLE INITIALLY DEFERRED;' % constraint_args,

            'ALTER TABLE %(table)s DROP CONSTRAINT %(constraint)s' % constraint_args,
        ),
    ]
