# Generated by Django 3.2.9 on 2024-06-06 15:33

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


class Migration(migrations.Migration):

    dependencies = [
        ('annotations', '0006_annotation_embedding'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('corpuses', '0002_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='CorpusQuery',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('backend_lock', models.BooleanField(default=False)),
                ('is_public', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('query', models.TextField()),
                ('response', models.TextField(blank=True, null=True)),
                ('started', models.DateTimeField(blank=True, null=True)),
                ('completed', models.DateTimeField(blank=True, null=True)),
                ('failed', models.DateTimeField(blank=True, null=True)),
                ('stacktrace', models.TextField(blank=True, null=True)),
                ('corpus', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='queries', to='corpuses.corpus')),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('sources', models.ManyToManyField(blank=True, null=True, related_name='queries', related_query_name='created_by_query', to='annotations.Annotation')),
                ('user_lock', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='locked_corpusquery_objects', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
