# Generated by Django 6.0.3 on 2026-04-16 10:35

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


class Migration(migrations.Migration):

    dependencies = [
        ('maintenance', '0001_initial'),
        ('properties', '0007_alter_building_options_alter_tenantexit_options_and_more'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='complaint',
            options={'ordering': ['-created_at']},
        ),
        migrations.AlterModelOptions(
            name='repairrequest',
            options={'ordering': ['-created_at']},
        ),
        migrations.AddField(
            model_name='complaint',
            name='unit',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='complaints', to='properties.unit'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='complaint',
            name='updated_at',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AddField(
            model_name='repairrequest',
            name='complaint',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='repairs', to='maintenance.complaint'),
        ),
        migrations.AddField(
            model_name='repairrequest',
            name='unit',
            field=models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, related_name='repairs', to='properties.unit'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='repairrequest',
            name='updated_at',
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name='complaint',
            name='tenant',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='complaints', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='repairrequest',
            name='tenant',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='repair_requests', to=settings.AUTH_USER_MODEL),
        ),
    ]
