# Generated by Django 5.1.15 on 2026-05-29 03:59

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("accounts", "0001_initial"),
        ("ai", "0001_initial"),
        ("projects", "0001_initial"),
    ]

    operations = [
        migrations.AddField(
            model_name="aitask",
            name="project",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="ai_tasks",
                to="projects.project",
            ),
        ),
        migrations.AddField(
            model_name="aitask",
            name="team",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="%(class)s_set",
                to="accounts.team",
            ),
        ),
        migrations.AddField(
            model_name="aitask",
            name="model_config",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.PROTECT,
                related_name="tasks",
                to="ai.modelconfig",
            ),
        ),
        migrations.AddField(
            model_name="modelconfig",
            name="provider",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="models",
                to="ai.modelprovider",
            ),
        ),
        migrations.AddIndex(
            model_name="aitask",
            index=models.Index(
                fields=["team", "status"], name="ai_aitask_team_id_710ece_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="aitask",
            index=models.Index(
                fields=["project", "task_type"], name="ai_aitask_project_f2850d_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="aitask",
            index=models.Index(
                fields=["provider_task_id"], name="ai_aitask_provide_67beef_idx"
            ),
        ),
        migrations.AlterUniqueTogether(
            name="modelconfig",
            unique_together={("provider", "name", "capability")},
        ),
    ]
