# Generated by Django 5.2.7 on 2025-11-12 14:21

import django.db.models.deletion
import mainapp.models
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('mainapp', '0001_initial'),
        ('mapsapp', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='objitem',
            name='transponder',
            field=models.ForeignKey(blank=True, help_text='Транспондер, с помощью которого была получена точка', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transponder', to='mapsapp.transponders', verbose_name='Транспондер'),
        ),
        migrations.AddField(
            model_name='objitem',
            name='updated_by',
            field=models.ForeignKey(blank=True, help_text='Пользователь, последним изменивший запись', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='objitems_updated', to='mainapp.customuser', verbose_name='Изменен пользователем'),
        ),
        migrations.AddField(
            model_name='geo',
            name='objitem',
            field=models.OneToOneField(help_text='Связанный объект', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='geo_obj', to='mainapp.objitem', verbose_name='Объект'),
        ),
        migrations.AddField(
            model_name='parameter',
            name='modulation',
            field=models.ForeignKey(blank=True, default=mainapp.models.get_default_modulation, null=True, on_delete=django.db.models.deletion.SET_DEFAULT, related_name='modulations', to='mainapp.modulation', verbose_name='Модуляция'),
        ),
        migrations.AddField(
            model_name='parameter',
            name='objitem',
            field=models.OneToOneField(blank=True, help_text='Связанный объект', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='parameter_obj', to='mainapp.objitem', verbose_name='Объект'),
        ),
        migrations.AddField(
            model_name='parameter',
            name='polarization',
            field=models.ForeignKey(blank=True, default=mainapp.models.get_default_polarization, null=True, on_delete=django.db.models.deletion.SET_DEFAULT, related_name='polarizations', to='mainapp.polarization', verbose_name='Поляризация'),
        ),
        migrations.AddField(
            model_name='satellite',
            name='band',
            field=models.ManyToManyField(blank=True, help_text='Диапазоны работы спутника', related_name='bands', to='mainapp.band', verbose_name='Диапазоны'),
        ),
        migrations.AddField(
            model_name='satellite',
            name='created_by',
            field=models.ForeignKey(blank=True, help_text='Пользователь, создавший запись', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='satellite_created', to='mainapp.customuser', verbose_name='Создан пользователем'),
        ),
        migrations.AddField(
            model_name='satellite',
            name='updated_by',
            field=models.ForeignKey(blank=True, help_text='Пользователь, последним изменивший запись', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='satellite_updated', to='mainapp.customuser', verbose_name='Изменен пользователем'),
        ),
        migrations.AddField(
            model_name='parameter',
            name='id_satellite',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='parameters', to='mainapp.satellite', verbose_name='Спутник'),
        ),
        migrations.AddField(
            model_name='sigmaparameter',
            name='id_satellite',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='sigmapar_sat', to='mainapp.satellite', verbose_name='Спутник'),
        ),
        migrations.AddField(
            model_name='sigmaparameter',
            name='modulation',
            field=models.ForeignKey(blank=True, default=mainapp.models.get_default_modulation, null=True, on_delete=django.db.models.deletion.SET_DEFAULT, related_name='modulations_sigma', to='mainapp.modulation', verbose_name='Модуляция'),
        ),
        migrations.AddField(
            model_name='sigmaparameter',
            name='parameter',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sigma_parameter', to='mainapp.parameter', verbose_name='ВЧ'),
        ),
        migrations.AddField(
            model_name='sigmaparameter',
            name='polarization',
            field=models.ForeignKey(blank=True, default=mainapp.models.get_default_polarization, null=True, on_delete=django.db.models.deletion.SET_DEFAULT, related_name='polarizations_sigma', to='mainapp.polarization', verbose_name='Поляризация'),
        ),
        migrations.AddField(
            model_name='sigmaparameter',
            name='mark',
            field=models.ManyToManyField(blank=True, to='mainapp.sigmaparmark', verbose_name='Отметка'),
        ),
        migrations.AddField(
            model_name='source',
            name='created_by',
            field=models.ForeignKey(blank=True, help_text='Пользователь, создавший запись', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='source_created', to='mainapp.customuser', verbose_name='Создан пользователем'),
        ),
        migrations.AddField(
            model_name='source',
            name='updated_by',
            field=models.ForeignKey(blank=True, help_text='Пользователь, последним изменивший запись', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='source_updated', to='mainapp.customuser', verbose_name='Изменен пользователем'),
        ),
        migrations.AddField(
            model_name='objitem',
            name='source',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='source', to='mainapp.source', verbose_name='ИРИ'),
        ),
        migrations.AddField(
            model_name='sigmaparameter',
            name='standard',
            field=models.ForeignKey(blank=True, default=mainapp.models.get_default_standard, null=True, on_delete=django.db.models.deletion.SET_DEFAULT, related_name='standards_sigma', to='mainapp.standard', verbose_name='Стандарт'),
        ),
        migrations.AddField(
            model_name='parameter',
            name='standard',
            field=models.ForeignKey(blank=True, default=mainapp.models.get_default_standard, null=True, on_delete=django.db.models.deletion.SET_DEFAULT, related_name='standards', to='mainapp.standard', verbose_name='Стандарт'),
        ),
        migrations.AddIndex(
            model_name='geo',
            index=models.Index(fields=['-timestamp'], name='mainapp_geo_timesta_58a605_idx'),
        ),
        migrations.AddIndex(
            model_name='geo',
            index=models.Index(fields=['location'], name='mainapp_geo_locatio_b855c9_idx'),
        ),
        migrations.AddConstraint(
            model_name='geo',
            constraint=models.UniqueConstraint(fields=('timestamp', 'coords'), name='unique_geo_combination'),
        ),
        migrations.AddIndex(
            model_name='objitem',
            index=models.Index(fields=['name'], name='mainapp_obj_name_e4f1e1_idx'),
        ),
        migrations.AddIndex(
            model_name='objitem',
            index=models.Index(fields=['-updated_at'], name='mainapp_obj_updated_f46b0e_idx'),
        ),
        migrations.AddIndex(
            model_name='objitem',
            index=models.Index(fields=['-created_at'], name='mainapp_obj_created_cba553_idx'),
        ),
        migrations.AddIndex(
            model_name='parameter',
            index=models.Index(fields=['id_satellite', 'frequency'], name='mainapp_par_id_sate_cbfab2_idx'),
        ),
        migrations.AddIndex(
            model_name='parameter',
            index=models.Index(fields=['frequency', 'polarization'], name='mainapp_par_frequen_75a049_idx'),
        ),
    ]
