# Generated by Django 3.1 on 2021-10-07 16:12

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import scraper.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Job',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('keyword', models.CharField(help_text='Search keyword', max_length=255)),
                ('since', models.DateTimeField(help_text='Filter Tweets since date(Example: 2017-12-26 00:00:00).', null=True)),
                ('until', models.DateTimeField(help_text='Filter Tweets sent until date(Example: 2017-12-27 00:00:00).', null=True)),
                ('twitter_username', models.CharField(blank=True, help_text="Twitter user's username", max_length=255, null=True)),
                ('limit', models.IntegerField(help_text='Number of Tweets to pull (Increments of 20)', validators=[scraper.models.validate_limit])),
                ('credits_required', models.IntegerField()),
                ('language', models.CharField(choices=[('ar', 'arabic'), ('en', 'english'), ('hi', 'hindi'), ('ml', 'malayalam')], help_text='Tweet language', max_length=255)),
                ('verified', models.BooleanField(help_text='Set to True to only show Tweets by _verified_ users')),
                ('output_type', models.CharField(choices=[('csv', 'csv'), ('json', 'json')], default='csv', help_text='Format in which you want to download the result', max_length=255)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobs', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Result',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('result_file', models.FileField(blank=True, upload_to='DataFiles/')),
                ('job', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='result', to='scraper.job')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
