47 lines
1.7 KiB
Python
47 lines
1.7 KiB
Python
# Generated by Django 5.2.4 on 2025-07-22 08:37
|
|
|
|
import django.db.models.deletion
|
|
import django.utils.timezone
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='ChatLog',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('user_message', models.TextField()),
|
|
('chatbot_response', models.TextField()),
|
|
('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
|
|
],
|
|
options={
|
|
'ordering': ['-timestamp'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='AnalysisCache',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('prompt_hash', models.CharField(db_index=True, max_length=64)),
|
|
('dealer_id', models.IntegerField(blank=True, db_index=True, null=True)),
|
|
('created_at', models.DateTimeField(default=django.utils.timezone.now)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('expires_at', models.DateTimeField(db_index=True)),
|
|
('result', models.JSONField()),
|
|
('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'verbose_name_plural': 'Analysis caches',
|
|
},
|
|
),
|
|
]
|