# Generated by Django 4.0.10 on 2023-06-03 13:39

import bitfield.models
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("eveuniverse", "0007_evetype_description"),
    ]

    operations = [
        migrations.CreateModel(
            name="EveIndustryActivity",
            fields=[
                ("id", models.IntegerField(primary_key=True, serialize=False)),
                ("description", models.CharField(max_length=100)),
                ("name", models.CharField(max_length=30)),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AlterField(
            model_name="evetype",
            name="enabled_sections",
            field=bitfield.models.BitField(
                (
                    "dogmas",
                    "graphics",
                    "market_groups",
                    "type_materials",
                    "industry_activities",
                ),
                default=None,
                help_text="Flags for loadable sections. True if instance was loaded with section.",
            ),
        ),
        migrations.CreateModel(
            name="EveIndustryActivitySkill",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("level", models.PositiveIntegerField(db_index=True)),
                (
                    "activity",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eveuniverse.eveindustryactivity",
                    ),
                ),
                (
                    "eve_type",
                    models.ForeignKey(
                        help_text="Blueprint type",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eveuniverse.evetype",
                    ),
                ),
                (
                    "skill_eve_type",
                    models.ForeignKey(
                        help_text="Skill book type",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveuniverse.evetype",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="EveIndustryActivityProduct",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("quantity", models.PositiveIntegerField()),
                (
                    "activity",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eveuniverse.eveindustryactivity",
                    ),
                ),
                (
                    "eve_type",
                    models.ForeignKey(
                        help_text="Blueprint type",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eveuniverse.evetype",
                    ),
                ),
                (
                    "product_eve_type",
                    models.ForeignKey(
                        help_text="Result type",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveuniverse.evetype",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="EveIndustryActivityMaterial",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("quantity", models.PositiveIntegerField()),
                (
                    "activity",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eveuniverse.eveindustryactivity",
                    ),
                ),
                (
                    "eve_type",
                    models.ForeignKey(
                        help_text="Blueprint type",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eveuniverse.evetype",
                    ),
                ),
                (
                    "material_eve_type",
                    models.ForeignKey(
                        help_text="Material required type",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="eveuniverse.evetype",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="EveIndustryActivityDuration",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("time", models.PositiveIntegerField()),
                (
                    "activity",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eveuniverse.eveindustryactivity",
                    ),
                ),
                (
                    "eve_type",
                    models.ForeignKey(
                        help_text="Blueprint type",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="eveuniverse.evetype",
                    ),
                ),
            ],
        ),
        migrations.AddConstraint(
            model_name="eveindustryactivityskill",
            constraint=models.UniqueConstraint(
                fields=("eve_type", "skill_eve_type", "activity"),
                name="fpk_eveindustryactivityskill",
            ),
        ),
        migrations.AddConstraint(
            model_name="eveindustryactivityproduct",
            constraint=models.UniqueConstraint(
                fields=("eve_type", "product_eve_type", "activity"),
                name="fpk_eveindustryactivityproduct",
            ),
        ),
        migrations.AddConstraint(
            model_name="eveindustryactivitymaterial",
            constraint=models.UniqueConstraint(
                fields=("eve_type", "material_eve_type", "activity"),
                name="fpk_eveindustryactivitymaterial",
            ),
        ),
        migrations.AddConstraint(
            model_name="eveindustryactivityduration",
            constraint=models.UniqueConstraint(
                fields=("eve_type", "activity"), name="fpk_eveindustryactivity"
            ),
        ),
    ]
