# Generated by Django 2.1.7 on 2019-03-25 05:52

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


class Migration(migrations.Migration):

    dependencies = [
        ('search', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Result',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('scanned', models.BooleanField(default=False, help_text='Has this resource had its links/words scanned?')),
                ('title', models.CharField(max_length=255)),
                ('blurb', models.TextField()),
                ('badges', models.ManyToManyField(related_name='pages', to='search.Badge')),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tag', models.CharField(max_length=200, unique=True)),
                ('results', models.ManyToManyField(related_name='tags', to='search.Result')),
                ('words', models.ManyToManyField(related_name='tags', to='search.Word')),
            ],
        ),
        migrations.CreateModel(
            name='URL',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.URLField(max_length=255, unique=True)),
                ('domain', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='search.Domain')),
            ],
        ),
        migrations.RemoveField(
            model_name='page',
            name='badges',
        ),
        migrations.RemoveField(
            model_name='page',
            name='domain',
        ),
        migrations.RemoveField(
            model_name='page',
            name='links_to',
        ),
        migrations.RemoveField(
            model_name='page',
            name='links_to_domains',
        ),
        migrations.RemoveField(
            model_name='page',
            name='words',
        ),
        migrations.DeleteModel(
            name='Page',
        ),
        migrations.AddField(
            model_name='result',
            name='links_to',
            field=models.ManyToManyField(related_name='links_from', to='search.URL'),
        ),
        migrations.AddField(
            model_name='result',
            name='links_to_domains',
            field=models.ManyToManyField(related_name='links_from', to='search.Domain'),
        ),
        migrations.AddField(
            model_name='result',
            name='url',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='search.URL'),
        ),
        migrations.AddField(
            model_name='result',
            name='words',
            field=models.ManyToManyField(related_name='pages', to='search.Word'),
        ),
    ]
