# Generated by Django 2.1.11 on 2019-09-10 03:04

from django.db import migrations
from django.db.models import F


def delete_unowned_raid_drops(apps, schema_editor):
    RiftRaidItemDrop = apps.get_model('data_log', 'RiftRaidItemDrop')
    RiftRaidMonsterDrop = apps.get_model('data_log', 'RiftRaidMonsterDrop')
    RiftRaidRuneCraftDrop = apps.get_model('data_log', 'RiftRaidRuneCraftDrop')

    for m in [RiftRaidItemDrop, RiftRaidMonsterDrop, RiftRaidRuneCraftDrop]:
        m.objects.exclude(log__wizard_id=F('wizard_id')).delete()


def noop(apps, schema_editor):
    pass


class Migration(migrations.Migration):

    dependencies = [
        ('data_log', '0017_auto_20190903_1245'),
    ]

    operations = [
        migrations.RunPython(delete_unowned_raid_drops, noop)
    ]

Remove drops from raid logs that are not owned by the user submitting the logs
Remove drops from raid logs that are not owned by the user submitting the logs
