# Generated by Django 3.2.5 on 2021-07-21 22:48

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Query',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=1000, unique=True)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Query',
                'verbose_name_plural': 'Queries',
            },
        ),
        migrations.CreateModel(
            name='Parent_Child',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('relevance', models.PositiveIntegerField()),
                ('date_created', models.DateTimeField(auto_now_add=True)),
                ('child', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='as_child', to='search.query')),
                ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='as_parent', to='search.query')),
            ],
            options={
                'verbose_name': 'Parent/Child Lookup',
                'verbose_name_plural': 'Parent/Child Lookups',
            },
        ),
        migrations.AddConstraint(
            model_name='parent_child',
            constraint=models.UniqueConstraint(fields=('parent', 'child'), name='unique_parent_child'),
        ),
    ]
