# Generated by Django 2.2.5 on 2019-09-10 19:07

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('params', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Query',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.CharField(default='', max_length=500)),
                ('attributes', models.ManyToManyField(related_name='included_in_queries', to='params.MbtaAttribute', verbose_name='Attributes')),
                ('includes', models.ManyToManyField(blank=True, related_name='included_in_queries', to='params.MbtaInclude', verbose_name='Include')),
                ('primary_object', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='queries', to='params.MbtaObject', verbose_name='Object')),
            ],
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('datetime', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date/time')),
                ('response_status_code', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='status code')),
                ('query', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requests', to='queries.Query')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='QueryFilter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('values', models.CharField(max_length=200)),
                ('on_attribute', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='query_instances', related_query_name='query_instance', to='params.MbtaFilter')),
                ('query', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='filters', related_query_name='filter', to='queries.Query')),
            ],
        ),
    ]
