# Generated by Django 2.1 on 2018-09-14 18:33

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


class Migration(migrations.Migration):

    dependencies = [('api', '0019_buyticket')]

    operations = [
        migrations.AddField(
            model_name='link',
            name='type',
            field=models.IntegerField(
                choices=[(100, 'procu'), (200, 'tracker')], null=True
            ),
        ),
        migrations.AlterField(
            model_name='link',
            name='object',
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                to='api.LinkObject',
            ),
        ),
        migrations.AlterUniqueTogether(
            name='link', unique_together={('enquiry', 'key')}
        ),
        migrations.AddIndex(
            model_name='enquiry',
            index=models.Index(
                fields=['key'], name='api_enquiry_key_846a49_idx'
            ),
        ),
        migrations.AddIndex(
            model_name='link',
            index=models.Index(fields=['key'], name='api_link_key_bda377_idx'),
        ),
        migrations.RunSQL(
            sql="""
            UPDATE api_link l SET type = o.type
            FROM api_linkobject o WHERE l.object_id = o.id;
            """,
            reverse_sql='',
            elidable=True,
        ),
    ]
