# Generated by Django 4.2.3 on 2023-07-11 13:53

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


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        pgvector.django.VectorExtension(),
        migrations.CreateModel(
            name="SourceDocument",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(blank=True, default="")),
                ("file", models.FileField(upload_to="")),
                ("indexed", models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name="DocumentChunk",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("metadata", models.JSONField()),
                ("page_content", models.TextField()),
                ("embedding", pgvector.django.VectorField(dimensions=768)),
                (
                    "source",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="django_langchain.sourcedocument",
                    ),
                ),
                ("index", models.IntegerField(default=0)),
            ],
        ),
    ]
