@@ -0,0 +1,60 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("jobs", "0002_geocode_location_lookup"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="AiAnalysisCache",
|
||||
fields=[
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
("content_hash", models.CharField(max_length=64, db_index=True)),
|
||||
("model_name", models.CharField(max_length=120)),
|
||||
("prompt_version", models.CharField(max_length=120)),
|
||||
("schema_version", models.CharField(default="1.0.0", max_length=24)),
|
||||
(
|
||||
"status",
|
||||
models.CharField(
|
||||
choices=[
|
||||
("ok", "Succes"),
|
||||
("disabled", "Uitgeschakeld"),
|
||||
("error", "Fout"),
|
||||
("timeout", "Timeout"),
|
||||
("invalid", "Ongeldige output"),
|
||||
],
|
||||
max_length=16,
|
||||
),
|
||||
),
|
||||
("error_category", models.CharField(blank=True, max_length=120)),
|
||||
("summary_nl", models.TextField(blank=True)),
|
||||
("features", models.JSONField(default=dict)),
|
||||
("warnings", models.JSONField(default=list, blank=True)),
|
||||
],
|
||||
options={
|
||||
"ordering": ["-updated_at"],
|
||||
},
|
||||
),
|
||||
migrations.AddConstraint(
|
||||
model_name="aianalysiscache",
|
||||
constraint=models.UniqueConstraint(
|
||||
fields=["content_hash", "model_name", "prompt_version", "schema_version"],
|
||||
name="unique_ai_analysis_cache",
|
||||
),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="aianalysiscache",
|
||||
index=models.Index(fields=["content_hash"], name="jobs_aianal_cache_content_idx"),
|
||||
),
|
||||
migrations.AddIndex(
|
||||
model_name="aianalysiscache",
|
||||
index=models.Index(fields=["model_name", "prompt_version", "schema_version"], name="jobs_aianal_cache_model_idx"),
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user