# Generated by Django 4.2.23 on 2025-07-20 12:36

# Django
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("indy_hub", "0016_productionconfig"),
    ]

    operations = [
        migrations.CreateModel(
            name="ProductionSimulation",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("blueprint_type_id", models.BigIntegerField()),
                ("blueprint_name", models.CharField(max_length=255)),
                ("runs", models.IntegerField(default=1)),
                ("simulation_name", models.CharField(blank=True, max_length=255)),
                ("total_items", models.IntegerField(default=0)),
                ("total_buy_items", models.IntegerField(default=0)),
                ("total_prod_items", models.IntegerField(default=0)),
                (
                    "estimated_cost",
                    models.DecimalField(decimal_places=2, default=0, max_digits=20),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-updated_at"],
                "default_permissions": (),
                "indexes": [
                    models.Index(
                        fields=["user", "-updated_at"],
                        name="indy_hub_pr_user_id_9b3f61_idx",
                    ),
                    models.Index(
                        fields=["user", "blueprint_type_id"],
                        name="indy_hub_pr_user_id_2038b4_idx",
                    ),
                ],
                "unique_together": {("user", "blueprint_type_id", "runs")},
            },
        ),
    ]
