# Generated by Django 4.2.2 on 2025-10-16 09:34

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


class Migration(migrations.Migration):

    dependencies = [
        ('productcropmapping', '0001_initial'),
        ('mydevicemanagement', '0003_remove_customerdevice_uniq_device_label_per_customer_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='MyDeviceMoistureThreshold',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mydevicethreshold', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True)),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='moisture_thresholds', to='mydevicemanagement.customerdevice')),
                ('mapping', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='device_thresholds', to='productcropmapping.productcropmapping')),
            ],
            options={
                'indexes': [models.Index(fields=['device'], name='mydeviceman_device__3ba594_idx'), models.Index(fields=['mapping'], name='mydeviceman_mapping_d177af_idx')],
            },
        ),
        migrations.AddConstraint(
            model_name='mydevicemoisturethreshold',
            constraint=models.UniqueConstraint(fields=('device', 'mapping'), name='uniq_device_mapping'),
        ),
    ]
