@@ -0,0 +1,1099 @@
+# Generated by Django 3.2.13 on 2022-05-31 09:53%0A%0Afrom django.db import migrations%0Afrom django.db.models.functions import Collate%0A%0Afrom olympia import amo%0A%0A%0Adef fix_missing_denied_guids_for_blocked_addons(apps, schema_editor):%0A    Addon = apps.get_model('addons', 'Addon')%0A    Block = apps.get_model('blocklist', 'Block')%0A    DeniedGuid = apps.get_model('addons', 'DeniedGuid')%0A    missing_denied_guids = (%0A        Addon.unfiltered.filter(%0A            guid__in=Block.objects.filter(min_version='0', max_version='*').values(%0A                guidc=Collate('guid', 'utf8mb4_unicode_ci')%0A            ),%0A            status=amo.STATUS_DELETED,%0A        )%0A        .exclude(guid__in=DeniedGuid.objects.values('guid'))%0A        .values_list('guid', flat=True)%0A        .distinct()%0A    )%0A    DeniedGuid.objects.bulk_create(%0A        %5BDeniedGuid(guid=guid) for guid in missing_denied_guids%5D%0A    )%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A    dependencies = %5B%0A        ('addons', '0038_auto_20220530_1639'),%0A    %5D%0A%0A    operations = %5B%0A        migrations.RunPython(fix_missing_denied_guids_for_blocked_addons),%0A    %5D%0A

Add migration to insert missing DeniedGuids from blocked add-ons (#19308)