feat(documents): 支持文档上传与本地RAG入库
This commit is contained in:
42
apps/documents/migrations/0001_initial.py
Normal file
42
apps/documents/migrations/0001_initial.py
Normal file
@@ -0,0 +1,42 @@
|
||||
# Generated by Django 5.2.14 on 2026-05-29 13:41
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = []
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="UploadedDocument",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("scenario_id", models.CharField(db_index=True, max_length=100)),
|
||||
("original_name", models.CharField(max_length=255)),
|
||||
("file", models.FileField(upload_to="documents/%Y%m%d/")),
|
||||
("file_type", models.CharField(max_length=20)),
|
||||
("size", models.PositiveIntegerField(default=0)),
|
||||
(
|
||||
"status",
|
||||
models.CharField(db_index=True, default="uploaded", max_length=20),
|
||||
),
|
||||
("error_message", models.TextField(blank=True)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
"ordering": ["-created_at"],
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user