# Generated by Django 4.2.9 on 2025-02-04 00:12

from django.db import migrations

def fb_pause(apps, schema_editor):
    RecurrentImport = apps.get_model("agenda_culturel", "RecurrentImport")

    rimports = RecurrentImport.objects.filter(processor="Facebook events").all()

    for r in rimports:
        r.downloader = "chromium (pause)"
    
    RecurrentImport.objects.bulk_update(rimports, fields=["downloader"])

def fb_pause_backward(apps, schema_editor):
    RecurrentImport = apps.get_model("agenda_culturel", "RecurrentImport")

    rimports = RecurrentImport.objects.filter(processor="Facebook events").all()

    for r in rimports:
        r.downloader = "chromium headless"
    
    RecurrentImport.objects.bulk_update(rimports, fields=["downloader"])



class Migration(migrations.Migration):

    dependencies = [
        ('agenda_culturel', '0144_event_agenda_cult_recurre_5c5094_idx'),
    ]

operations = [
        migrations.RunPython(
            fb_pause,
            fb_pause_backward,
        ),
    ]