104 lines
6.1 KiB
Python
104 lines
6.1 KiB
Python
# Generated by Django 5.2.8 on 2025-11-26 13:41
|
|
|
|
import django.db.models.deletion
|
|
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='ScamTag',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=100, unique=True)),
|
|
('slug', models.SlugField(blank=True, max_length=100, unique=True)),
|
|
('description', models.TextField(blank=True)),
|
|
('color', models.CharField(default='#007bff', help_text='Hex color code for display', max_length=7)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Scam Tag',
|
|
'verbose_name_plural': 'Scam Tags',
|
|
'db_table': 'reports_scamtag',
|
|
'ordering': ['name'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ScamReport',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('is_anonymous', models.BooleanField(default=False, help_text='Report submitted anonymously')),
|
|
('title', models.CharField(max_length=200)),
|
|
('description', models.TextField()),
|
|
('scam_type', models.CharField(choices=[('phishing', 'Phishing'), ('fake_website', 'Fake Website'), ('romance_scam', 'Romance Scam'), ('investment_scam', 'Investment Scam'), ('tech_support_scam', 'Tech Support Scam'), ('identity_theft', 'Identity Theft'), ('fake_product', 'Fake Product'), ('advance_fee', 'Advance Fee Fraud'), ('other', 'Other')], default='other', max_length=50)),
|
|
('reported_url', models.URLField(blank=True, max_length=500, null=True)),
|
|
('reported_email', models.EmailField(blank=True, max_length=254, null=True)),
|
|
('reported_phone', models.CharField(blank=True, max_length=20, null=True)),
|
|
('reported_company', models.CharField(blank=True, max_length=200, null=True)),
|
|
('evidence_files', models.JSONField(blank=True, default=list, help_text='List of file paths for evidence')),
|
|
('status', models.CharField(choices=[('pending', 'Pending Review'), ('under_review', 'Under Review'), ('verified', 'Verified'), ('rejected', 'Rejected'), ('archived', 'Archived')], default='pending', max_length=20)),
|
|
('verification_score', models.IntegerField(default=0, help_text='OSINT verification confidence score (0-100)')),
|
|
('is_public', models.BooleanField(default=True, help_text='Visible in public database')),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('verified_at', models.DateTimeField(blank=True, null=True)),
|
|
('reporter_ip', models.GenericIPAddressField(blank=True, null=True)),
|
|
('reporter', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reports', to=settings.AUTH_USER_MODEL)),
|
|
('tags', models.ManyToManyField(blank=True, related_name='reports', to='reports.scamtag')),
|
|
],
|
|
options={
|
|
'verbose_name': 'Scam Report',
|
|
'verbose_name_plural': 'Scam Reports',
|
|
'db_table': 'reports_scamreport',
|
|
'ordering': ['-created_at'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ScamVerification',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('verification_method', models.CharField(choices=[('whois', 'WHOIS Lookup'), ('dns', 'DNS Records'), ('ssl', 'SSL Certificate'), ('archive', 'Wayback Machine'), ('email_check', 'Email Validation'), ('phone_check', 'Phone Validation'), ('business_registry', 'Business Registry'), ('social_media', 'Social Media'), ('manual', 'Manual Review')], max_length=50)),
|
|
('verification_data', models.JSONField(default=dict, help_text='Raw verification data')),
|
|
('confidence_score', models.IntegerField(default=0, help_text='Confidence score for this verification (0-100)')),
|
|
('notes', models.TextField(blank=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('report', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='verifications', to='reports.scamreport')),
|
|
('verified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='verifications', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Scam Verification',
|
|
'verbose_name_plural': 'Scam Verifications',
|
|
'db_table': 'reports_scamverification',
|
|
'ordering': ['-created_at'],
|
|
},
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='scamreport',
|
|
index=models.Index(fields=['status', 'created_at'], name='reports_sca_status_91c8ad_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='scamreport',
|
|
index=models.Index(fields=['scam_type', 'status'], name='reports_sca_scam_ty_fd12f9_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='scamreport',
|
|
index=models.Index(fields=['reported_url'], name='reports_sca_reporte_ebc596_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='scamreport',
|
|
index=models.Index(fields=['reported_email'], name='reports_sca_reporte_c31241_idx'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='scamreport',
|
|
index=models.Index(fields=['reported_phone'], name='reports_sca_reporte_33869d_idx'),
|
|
),
|
|
]
|