# Generated by Django 5.1.6 on 2025-03-04 01:26

import datetime

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="optimer_management", content_type=ct, name="optimer_management")
    Permission.objects.get_or_create(codename="optimer_view", content_type=ct, name="optimer_view")


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


class Migration(migrations.Migration):

    replaces = [('optimer', '0001_initial'), ('optimer', '0002_auto_20170413_0442'), ('optimer', '0003_make_strings_more_stringy'), ('optimer', '0004_on_delete'), ('optimer', '0005_add_type_and_description')]

    initial = True

    dependencies = [
        ('eveonline', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='OpTimerType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(default='', max_length=254)),
            ],
            options={
                'ordering': ['type'],
                'default_permissions': (),
            },
        ),
        migrations.CreateModel(
            name='optimer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('doctrine', models.CharField(default='', max_length=254)),
                ('system', models.CharField(default='', max_length=254)),
                ('start', models.DateTimeField(default=datetime.datetime.now)),
                ('duration', models.CharField(default='', max_length=25)),
                ('operation_name', models.CharField(default='', max_length=254)),
                ('fc', models.CharField(default='', max_length=254)),
                ('post_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('eve_character', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='eveonline.evecharacter')),
                ('description', models.TextField(blank=True, default='')),
                ('type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='optimer.optimertype')),
            ],
            options={
                'ordering': ['start'],
                'default_permissions': (),
            },
        ),
        migrations.RunPython(create_permissions, reverse)
    ]
