41 lines
1.6 KiB
Python
41 lines
1.6 KiB
Python
# Generated by Django 5.2.7 on 2026-03-22 21:58
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Source',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=255, unique=True)),
|
|
('description', models.TextField(blank=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Entity',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('entity_type', models.CharField(choices=[('PERSON', 'Person'), ('EMAIL', 'Email'), ('USERNAME', 'Username'), ('IP', 'IP Address')], max_length=20)),
|
|
('value', models.CharField(db_index=True, max_length=255)),
|
|
('confidence_score', models.FloatField(default=1.0)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entities', to='core.source')),
|
|
],
|
|
options={
|
|
'verbose_name_plural': 'Entities',
|
|
'unique_together': {('entity_type', 'value', 'source')},
|
|
},
|
|
),
|
|
]
|