# Generated by Django 4.2.16 on 2026-03-24 09:48

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('gears', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name='usergear',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='inventory', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='rigitem',
            name='rig',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rig_items', to='gears.rig'),
        ),
        migrations.AddField(
            model_name='rigitem',
            name='user_gear',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rig_items', to='gears.usergear'),
        ),
        migrations.AddField(
            model_name='rig',
            name='items',
            field=models.ManyToManyField(related_name='rigs', through='gears.RigItem', to='gears.usergear'),
        ),
        migrations.AddField(
            model_name='rig',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='rigs', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='gear',
            name='reviewed_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='reviewed_gears', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='gear',
            name='submitted_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='submitted_gears', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddConstraint(
            model_name='rigitem',
            constraint=models.UniqueConstraint(fields=('rig', 'user_gear'), name='unique_gear_per_rig'),
        ),
        migrations.AddConstraint(
            model_name='rig',
            constraint=models.UniqueConstraint(fields=('user', 'name'), name='unique_rig_per_user'),
        ),
        migrations.AddConstraint(
            model_name='gear',
            constraint=models.UniqueConstraint(fields=('brand', 'model_name'), name='unique_gear_brand_model'),
        ),
    ]
