# Generated by Django 5.2.7 on 2025-10-06 11:28

import django.db.models.deletion
import sitemanagement.constants.image_file_path
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('sitemanagement', '0005_alter_alert_message_alter_alert_metric_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='Object',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255, verbose_name='Название')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Описание')),
                ('image', models.ImageField(blank=True, null=True, upload_to=sitemanagement.constants.image_file_path.register_object_upload_path, verbose_name='Изображение')),
                ('address', models.CharField(max_length=255, verbose_name='Адрес')),
                ('floors', models.PositiveSmallIntegerField(verbose_name='Количество этажей')),
                ('area', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Площадь')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Объект',
                'verbose_name_plural': 'Объекты',
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='Zone',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Название')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('object', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='zones', to='sitemanagement.object', verbose_name='Объект')),
                ('sensors', models.ManyToManyField(related_name='zones', to='sitemanagement.sensor', verbose_name='Датчики')),
            ],
            options={
                'verbose_name': 'Зона',
                'verbose_name_plural': 'Зоны',
                'ordering': ['object', 'name'],
            },
        ),
    ]
