# Generated by Django 5.2.6 on 2025-10-11 08:49 from django.db import migrations, models from django.utils import timezone def set_initial_last_successful_fetch(apps, schema_editor): """ Set last_successful_fetch to current time for all existing feeds. This prevents existing feeds from being deleted on first cleanup run. """ Feed = apps.get_model("feeds", "Feed") Feed.objects.all().update(last_successful_fetch=timezone.now()) class Migration(migrations.Migration): dependencies = [ ("feeds", "0005_post_group"), ] operations = [ migrations.AddField( model_name="feed", name="last_successful_fetch", field=models.DateTimeField( blank=True, help_text="Last time this feed was successfully fetched with HTTP 200", null=True, ), ), migrations.RunPython( set_initial_last_successful_fetch, migrations.RunPython.noop ), ]