# Generated by Copilot for blueprint copy sharing
# Django
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("indy_hub", "0004_alter_characterupdatetracker_options_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="BlueprintCopyShareSetting",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("allow_copy_requests", models.BooleanField(default=False)),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="bp_copy_share_setting",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="BlueprintCopyRequest",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("type_id", models.IntegerField()),
                ("material_efficiency", models.IntegerField()),
                ("time_efficiency", models.IntegerField()),
                ("runs_requested", models.IntegerField(default=1)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("fulfilled", models.BooleanField(default=False)),
                ("fulfilled_at", models.DateTimeField(null=True, blank=True)),
                (
                    "requested_by",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="bp_copy_requests",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "unique_together": {
                    (
                        "type_id",
                        "material_efficiency",
                        "time_efficiency",
                        "requested_by",
                        "fulfilled",
                    )
                },
            },
        ),
    ]
