# Generated by Django 4.2

from django.db import migrations, models


class Migration(migrations.Migration):
    """
    Remove legacy campaign-based models and add permissions to MonthlyKillmail.

    This migration:
    1. Adds the basic_access permission to MonthlyKillmail
    2. Removes the legacy Campaign, CampaignMember, CampaignTarget, and CampaignKillmail models

    WARNING: This migration is destructive and will delete all legacy campaign data.
    Ensure data has been migrated to MonthlyKillmail before running this migration.
    """

    dependencies = [
        ('aatps', '0007_migrate_campaign_killmails'),
    ]

    operations = [
        # Add permissions to MonthlyKillmail
        migrations.AlterModelOptions(
            name='monthlykillmail',
            options={
                'default_permissions': (),
                'permissions': (('basic_access', 'Can access this app'),),
            },
        ),

        # Remove legacy models (order matters due to foreign keys)
        # First remove models that depend on Campaign
        migrations.DeleteModel(
            name='CampaignKillmail',
        ),
        migrations.DeleteModel(
            name='CampaignMember',
        ),
        migrations.DeleteModel(
            name='CampaignTarget',
        ),
        # Finally remove Campaign itself
        migrations.DeleteModel(
            name='Campaign',
        ),
    ]
