# 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 = [
        ('properties', '0006_tenantexit'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='building',
            options={'ordering': ['-created_at']},
        ),
        migrations.AlterModelOptions(
            name='tenantexit',
            options={'ordering': ['-created_at']},
        ),
        migrations.AlterModelOptions(
            name='unit',
            options={'ordering': ['-created_at']},
        ),
        migrations.AlterModelOptions(
            name='unitinspection',
            options={'ordering': ['-created_at']},
        ),
        migrations.AlterModelOptions(
            name='unitrenthistory',
            options={'ordering': ['-changed_at']},
        ),
        migrations.AlterModelOptions(
            name='unittenanthistory',
            options={'ordering': ['-start_date']},
        ),
        migrations.AlterUniqueTogether(
            name='unit',
            unique_together={('building', 'unit_number')},
        ),
        migrations.AddField(
            model_name='unit',
            name='created_by',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='created_units', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterField(
            model_name='unitinspection',
            name='unit',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='inspections', to='properties.unit'),
        ),
        migrations.RemoveField(
            model_name='unit',
            name='is_occupied',
        ),
    ]
