You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
2.6 KiB
53 lines
2.6 KiB
# Generated by Django 6.0.8 on 2026-08-08 07:53
|
|
|
|
import crawler.models
|
|
import django.db.models.deletion
|
|
import uuid
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='CrawlTask',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('title', models.CharField(max_length=255)),
|
|
('divar_url', models.URLField(validators=[crawler.models.validate_divar_url])),
|
|
('detection_prompt', models.TextField()),
|
|
('interval_minutes', models.IntegerField(choices=[(5, '5 Minutes'), (15, '15 Minutes'), (30, '30 Minutes'), (60, '1 Hour'), (120, '2 Hours'), (180, '3 Hours'), (240, '4 Hours'), (300, '5 Hours'), (360, '6 Hours')], default=60)),
|
|
('start_hour', models.TimeField()),
|
|
('end_hour', models.TimeField()),
|
|
('telegram_channel_id', models.CharField(blank=True, max_length=100, null=True)),
|
|
('is_active', models.BooleanField(default=True)),
|
|
],
|
|
options={
|
|
'indexes': [models.Index(fields=['is_active'], name='crawler_cra_is_acti_b67d0a_idx'), models.Index(fields=['created_at'], name='crawler_cra_created_920fb7_idx'), models.Index(fields=['title'], name='crawler_cra_title_dfbb5f_idx')],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='CrawlRun',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('started_at', models.DateTimeField(auto_now_add=True)),
|
|
('finished_at', models.DateTimeField(blank=True, null=True)),
|
|
('status', models.CharField(choices=[('RUNNING', 'Running'), ('SUCCESS', 'Success'), ('FAILED', 'Failed')], default='RUNNING', max_length=20)),
|
|
('ads_fetched_count', models.IntegerField(default=0)),
|
|
('ads_evaluated_count', models.IntegerField(default=0)),
|
|
('ads_flagged_count', models.IntegerField(default=0)),
|
|
('error_log', models.TextField(blank=True, null=True)),
|
|
('crawl_task', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='runs', to='crawler.crawltask')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
]
|