# Generated by Django 5.1.6 on 2025-03-05 01:07

import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models


def create_permissions(apps, schema_editor) -> None:
    # Remnant of AAv0
    User = apps.get_model('auth', 'User')
    ContentType = apps.get_model('contenttypes', 'ContentType')
    Permission = apps.get_model('auth', 'Permission')
    ct = ContentType.objects.get_for_model(User)
    Permission.objects.get_or_create(codename="srp_management", content_type=ct, name="srp_management")


def reverse(apps, schema_editor) -> None:
    pass


class Migration(migrations.Migration):

    replaces = [('srp', '0001_initial'), ('srp', '0002_srpuserrequest_srp_status_choices'), ('srp', '0003_make_strings_more_stringy'), ('srp', '0004_on_delete'), ('srp', '0005_alter_srpfleetmain_options')]

    initial = True

    dependencies = [
        ('eveonline', '0019_v5squash'),
    ]

    operations = [
        migrations.CreateModel(
            name='SrpFleetMain',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fleet_name', models.CharField(default='', max_length=254)),
                ('fleet_doctrine', models.CharField(default='', max_length=254)),
                ('fleet_time', models.DateTimeField()),
                ('fleet_srp_code', models.CharField(default='', max_length=254)),
                ('fleet_srp_status', models.CharField(default='', max_length=254)),
                ('fleet_srp_aar_link', models.CharField(default='', max_length=254)),
                ('fleet_commander', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='eveonline.evecharacter')),
            ],
            options={
                'permissions': (('access_srp', 'Can access SRP module'), ('add_srpfleetmain', 'Can access SRP module')),
                'default_permissions': (),
            },
        ),
        migrations.CreateModel(
            name='SrpUserRequest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('killboard_link', models.CharField(default='', max_length=254)),
                ('after_action_report_link', models.CharField(default='', max_length=254)),
                ('additional_info', models.CharField(default='', max_length=254)),
                ('srp_status', models.CharField(choices=[('Pending', 'Pending'), ('Approved', 'Approved'), ('Rejected', 'Rejected')], default='Pending', max_length=8)),
                ('srp_total_amount', models.BigIntegerField(default=0)),
                ('kb_total_loss', models.BigIntegerField(default=0)),
                ('srp_ship_name', models.CharField(default='', max_length=254)),
                ('post_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('character', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='eveonline.evecharacter')),
                ('srp_fleet_main', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='srp.srpfleetmain')),
            ],
        ),
        migrations.RunPython(create_permissions, reverse)
    ]
