38 lines
1.8 KiB
Python
38 lines
1.8 KiB
Python
# Generated by Django 5.2.7 on 2026-06-13 09:41
|
|
|
|
import django.utils.timezone
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='ThreatScan',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('scan_type', models.CharField(choices=[('url', 'URL / Website'), ('message', 'Email / Message')], max_length=20)),
|
|
('target_preview', models.CharField(help_text='Sanitized preview only; raw sensitive content is not stored.', max_length=220)),
|
|
('content_hash', models.CharField(db_index=True, max_length=64)),
|
|
('risk_score', models.PositiveSmallIntegerField(default=0)),
|
|
('risk_level', models.CharField(choices=[('low', 'Low'), ('medium', 'Medium'), ('high', 'High'), ('critical', 'Critical')], default='low', max_length=20)),
|
|
('verdict', models.CharField(max_length=160)),
|
|
('explanation', models.TextField()),
|
|
('indicators', models.JSONField(blank=True, default=list)),
|
|
('recommended_actions', models.JSONField(blank=True, default=list)),
|
|
('model_version', models.CharField(default='heuristic-nlp-v1', max_length=40)),
|
|
('store_metadata', models.BooleanField(default=True)),
|
|
('created_at', models.DateTimeField(db_index=True, default=django.utils.timezone.now)),
|
|
],
|
|
options={
|
|
'ordering': ['-created_at'],
|
|
'indexes': [models.Index(fields=['scan_type', 'risk_level'], name='core_threat_scan_ty_620347_idx'), models.Index(fields=['created_at'], name='core_threat_created_e17dbf_idx')],
|
|
},
|
|
),
|
|
]
|