# 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 = [
        ('accounts', '0001_initial'),
        ('auth', '0012_alter_user_first_name_max_length'),
        ('contenttypes', '0002_remove_content_type_name'),
        ('organizations', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='user',
            name='department',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='users', to='organizations.department'),
        ),
        migrations.AddField(
            model_name='user',
            name='groups',
            field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.group', verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='user',
            name='hospital',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='users', to='organizations.hospital'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.permission', verbose_name='user permissions'),
        ),
        migrations.AddIndex(
            model_name='acknowledgementcategory',
            index=models.Index(fields=['is_active', 'order'], name='accounts_ac_is_acti_333162_idx'),
        ),
        migrations.AddIndex(
            model_name='acknowledgementcategory',
            index=models.Index(fields=['is_default'], name='accounts_ac_is_defa_26f15a_idx'),
        ),
        migrations.AddField(
            model_name='acknowledgementchecklistitem',
            name='category',
            field=models.ForeignKey(help_text='Category/Department this acknowledgement belongs to', on_delete=django.db.models.deletion.PROTECT, related_name='checklist_items', to='accounts.acknowledgementcategory'),
        ),
        migrations.AddField(
            model_name='acknowledgementcontent',
            name='category',
            field=models.ForeignKey(help_text='Category this content belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='content_sections', to='accounts.acknowledgementcategory'),
        ),
        migrations.AddField(
            model_name='acknowledgementchecklistitem',
            name='content',
            field=models.ForeignKey(blank=True, help_text='Related content section', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='checklist_items', to='accounts.acknowledgementcontent'),
        ),
        migrations.AddField(
            model_name='checklistitemversion',
            name='changed_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='checklist_versions_created', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='checklistitemversion',
            name='checklist_item',
            field=models.ForeignKey(help_text='The checklist item this version belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='accounts.acknowledgementchecklistitem'),
        ),
        migrations.AddField(
            model_name='checklistitemversion',
            name='content',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='checklist_versions', to='accounts.acknowledgementcontent'),
        ),
        migrations.AddField(
            model_name='contentchangelog',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='content_change_logs', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='contentversion',
            name='changed_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='content_versions_created', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='contentversion',
            name='content',
            field=models.ForeignKey(help_text='The content this version belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='accounts.acknowledgementcontent'),
        ),
        migrations.AddField(
            model_name='employeeacknowledgement',
            name='employee',
            field=models.ForeignKey(help_text='Employee who signed', on_delete=django.db.models.deletion.CASCADE, related_name='employee_acknowledgements', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='employeeacknowledgement',
            name='sent_by',
            field=models.ForeignKey(blank=True, help_text='Admin who sent this acknowledgement', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sent_acknowledgements', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='role',
            name='group',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='role_config', to='auth.group'),
        ),
        migrations.AddField(
            model_name='role',
            name='permissions',
            field=models.ManyToManyField(blank=True, to='auth.permission'),
        ),
        migrations.AddField(
            model_name='employeeacknowledgement',
            name='acknowledgement',
            field=models.ForeignKey(help_text='Acknowledgement that was signed', on_delete=django.db.models.deletion.CASCADE, related_name='employee_signatures', to='accounts.simpleacknowledgement'),
        ),
        migrations.AddField(
            model_name='staffactivitylog',
            name='content_type',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='contenttypes.contenttype'),
        ),
        migrations.AddField(
            model_name='staffactivitylog',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='activity_logs', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='useracknowledgement',
            name='checklist_item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_acknowledgements', to='accounts.acknowledgementchecklistitem'),
        ),
        migrations.AddField(
            model_name='useracknowledgement',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='acknowledgements', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='userprovisionallog',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='provisional_logs', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddIndex(
            model_name='user',
            index=models.Index(fields=['is_active', '-date_joined'], name='accounts_us_is_acti_a32178_idx'),
        ),
        migrations.AddIndex(
            model_name='acknowledgementcontent',
            index=models.Index(fields=['category', 'is_active', 'order'], name='accounts_ac_categor_6ccab8_idx'),
        ),
        migrations.AddIndex(
            model_name='acknowledgementchecklistitem',
            index=models.Index(fields=['category', 'is_active', 'order'], name='accounts_ac_categor_d5334e_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='checklistitemversion',
            unique_together={('checklist_item', 'version_number')},
        ),
        migrations.AlterUniqueTogether(
            name='contentversion',
            unique_together={('content', 'version_number')},
        ),
        migrations.AlterUniqueTogether(
            name='employeeacknowledgement',
            unique_together={('employee', 'acknowledgement')},
        ),
        migrations.AddIndex(
            model_name='staffactivitylog',
            index=models.Index(fields=['user', '-created_at'], name='accounts_st_user_id_430335_idx'),
        ),
        migrations.AddIndex(
            model_name='staffactivitylog',
            index=models.Index(fields=['activity_type', '-created_at'], name='accounts_st_activit_8a40be_idx'),
        ),
        migrations.AddIndex(
            model_name='staffactivitylog',
            index=models.Index(fields=['module', '-created_at'], name='accounts_st_module_298d52_idx'),
        ),
        migrations.AddIndex(
            model_name='staffactivitylog',
            index=models.Index(fields=['content_type', 'object_id'], name='accounts_st_content_9ead09_idx'),
        ),
        migrations.AddIndex(
            model_name='useracknowledgement',
            index=models.Index(fields=['user', '-acknowledged_at'], name='accounts_us_user_id_7ba948_idx'),
        ),
        migrations.AddIndex(
            model_name='useracknowledgement',
            index=models.Index(fields=['checklist_item', '-acknowledged_at'], name='accounts_us_checkli_870e26_idx'),
        ),
        migrations.AlterUniqueTogether(
            name='useracknowledgement',
            unique_together={('user', 'checklist_item')},
        ),
        migrations.AddIndex(
            model_name='userprovisionallog',
            index=models.Index(fields=['user', '-created_at'], name='accounts_us_user_id_c488d5_idx'),
        ),
        migrations.AddIndex(
            model_name='userprovisionallog',
            index=models.Index(fields=['event_type', '-created_at'], name='accounts_us_event_t_b7f691_idx'),
        ),
    ]
