# Generated by Django 6.0.1 on 2026-05-11 20:32

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('projects', '0001_initial'),
        ('px_action_center', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name='qiproject',
            name='related_actions',
            field=models.ManyToManyField(blank=True, related_name='qi_projects', to='px_action_center.pxaction'),
        ),
        migrations.AddField(
            model_name='qiproject',
            name='team_members',
            field=models.ManyToManyField(blank=True, related_name='qi_projects', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='pdcaphase',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pdca_phases', to='projects.qiproject'),
        ),
        migrations.AddField(
            model_name='focusphase',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='focus_phases', to='projects.qiproject'),
        ),
        migrations.AddField(
            model_name='qiprojecttask',
            name='assigned_to',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='qi_tasks', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='qiprojecttask',
            name='focus_phase',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='projects.focusphase'),
        ),
        migrations.AddField(
            model_name='qiprojecttask',
            name='pdca_phase',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='projects.pdcaphase'),
        ),
        migrations.AddField(
            model_name='qiprojecttask',
            name='project',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='projects.qiproject'),
        ),
        migrations.AddIndex(
            model_name='qiproject',
            index=models.Index(fields=['hospital', 'status', '-created_at'], name='projects_qi_hospita_e5dfc7_idx'),
        ),
        migrations.AddIndex(
            model_name='qiproject',
            index=models.Index(fields=['is_template', 'hospital'], name='projects_qi_is_temp_df9bbd_idx'),
        ),
        migrations.AddIndex(
            model_name='qiproject',
            index=models.Index(fields=['project_lead', 'status'], name='projects_qi_project_3691bd_idx'),
        ),
        migrations.AddIndex(
            model_name='qiproject',
            index=models.Index(fields=['status', 'target_completion_date'], name='projects_qi_status_635dda_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='pdcaphase',
            unique_together={('project', 'phase')},
        ),
        migrations.AlterUniqueTogether(
            name='focusphase',
            unique_together={('project', 'phase')},
        ),
    ]
