# Generated by Django 3.0.8 on 2020-08-06 12:25

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Search',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('query', models.CharField(max_length=100, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='SearchResult',
            fields=[
                ('id', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=100)),
                ('htmlTitle', models.CharField(max_length=125)),
                ('link', models.CharField(max_length=150)),
                ('snippet', models.CharField(max_length=300)),
            ],
        ),
        migrations.CreateModel(
            name='SearchMeta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('page', models.IntegerField()),
                ('result', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engine.SearchResult')),
                ('search', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='engine.Search')),
            ],
        ),
        migrations.AddField(
            model_name='search',
            name='results',
            field=models.ManyToManyField(related_name='search', through='engine.SearchMeta', to='engine.SearchResult'),
        ),
    ]
