# Generated by Django 4.2.2 on 2025-09-15 04:17

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


class Migration(migrations.Migration):

    dependencies = [
        ('customermanagement', '0003_customer_privacy_policy_accepted_and_more'),
        ('mydevicemanagement', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='shareDevice',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('shared_at', models.DateTimeField(auto_now_add=True)),
                ('device', models.ForeignKey(help_text='The device being shared.', on_delete=django.db.models.deletion.CASCADE, related_name='shared_with', to='mydevicemanagement.customerdevice')),
                ('shared_with', models.ForeignKey(help_text='Customer with whom the device is shared.', on_delete=django.db.models.deletion.CASCADE, related_name='shared_devices', to='customermanagement.customer')),
            ],
            options={
                'ordering': ['-shared_at'],
                'indexes': [models.Index(fields=['shared_with'], name='mydeviceman_shared__84eaa1_idx')],
            },
        ),
        migrations.AddConstraint(
            model_name='sharedevice',
            constraint=models.UniqueConstraint(fields=('device', 'shared_with'), name='uniq_device_shared_with_customer'),
        ),
    ]
