# Generated by Django 4.2.16 on 2026-03-30 09:39

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('gears', '0011_rig_ballistic_fields'),
        ('tools', '0003_remove_shotgroup_result_picture_delete_resultpicture'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='PRSSession',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, verbose_name='name')),
                ('date', models.DateField(verbose_name='date')),
                ('location', models.CharField(blank=True, max_length=255, verbose_name='location')),
                ('temperature_c', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True, verbose_name='temperature (°C)')),
                ('wind_speed_ms', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True, verbose_name='wind speed (m/s)')),
                ('wind_direction_deg', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='wind direction (°)')),
                ('humidity_pct', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='humidity (%)')),
                ('pressure_hpa', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True, verbose_name='pressure (hPa)')),
                ('weather_notes', models.TextField(blank=True, verbose_name='weather notes')),
                ('notes', models.TextField(blank=True, verbose_name='notes')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='updated at')),
                ('competition_name', models.CharField(blank=True, max_length=255, verbose_name='competition name')),
                ('category', models.CharField(blank=True, max_length=100, verbose_name='category')),
                ('ammo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='gears.ammo', verbose_name='factory ammo')),
                ('reloaded_batch', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='gears.reloadedammobatch', verbose_name='reloaded batch')),
                ('rig', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='gears.rig', verbose_name='rig')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='user')),
            ],
            options={
                'verbose_name': 'PRS session',
                'verbose_name_plural': 'PRS sessions',
                'ordering': ['-date', '-created_at'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SpeedShootingSession',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, verbose_name='name')),
                ('date', models.DateField(verbose_name='date')),
                ('location', models.CharField(blank=True, max_length=255, verbose_name='location')),
                ('temperature_c', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True, verbose_name='temperature (°C)')),
                ('wind_speed_ms', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True, verbose_name='wind speed (m/s)')),
                ('wind_direction_deg', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='wind direction (°)')),
                ('humidity_pct', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='humidity (%)')),
                ('pressure_hpa', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True, verbose_name='pressure (hPa)')),
                ('weather_notes', models.TextField(blank=True, verbose_name='weather notes')),
                ('notes', models.TextField(blank=True, verbose_name='notes')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='updated at')),
                ('format', models.CharField(blank=True, max_length=100, verbose_name='format')),
                ('rounds_fired', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='rounds fired')),
                ('ammo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='gears.ammo', verbose_name='factory ammo')),
                ('reloaded_batch', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='gears.reloadedammobatch', verbose_name='reloaded batch')),
                ('rig', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='gears.rig', verbose_name='rig')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='user')),
            ],
            options={
                'verbose_name': 'speed shooting session',
                'verbose_name_plural': 'speed shooting sessions',
                'ordering': ['-date', '-created_at'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PRSStage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.PositiveSmallIntegerField(verbose_name='order')),
                ('position', models.CharField(choices=[('PRONE', 'Prone'), ('STANDING', 'Standing'), ('SITTING', 'Sitting'), ('KNEELING', 'Kneeling'), ('BARRICADE', 'Barricade'), ('UNSUPPORTED', 'Unsupported'), ('OTHER', 'Other')], default='PRONE', max_length=20, verbose_name='shooting position')),
                ('distance_m', models.PositiveSmallIntegerField(verbose_name='distance (m)')),
                ('target_width_cm', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True, verbose_name='target width (cm)')),
                ('target_height_cm', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True, verbose_name='target height (cm)')),
                ('max_time_s', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='max time (s)')),
                ('shots_count', models.PositiveSmallIntegerField(default=1, verbose_name='shots count')),
                ('notes_prep', models.TextField(blank=True, verbose_name='prep notes')),
                ('computed_elevation', models.DecimalField(blank=True, decimal_places=2, max_digits=6, null=True, verbose_name='computed elevation')),
                ('computed_windage', models.DecimalField(blank=True, decimal_places=2, max_digits=6, null=True, verbose_name='computed windage')),
                ('correction_unit', models.CharField(blank=True, choices=[('MOA', 'MOA'), ('MRAD', 'MRAD'), ('CLICK', 'Clicks')], max_length=10, verbose_name='correction unit')),
                ('actual_elevation', models.DecimalField(blank=True, decimal_places=2, max_digits=6, null=True, verbose_name='actual elevation')),
                ('actual_windage', models.DecimalField(blank=True, decimal_places=2, max_digits=6, null=True, verbose_name='actual windage')),
                ('hits', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='hits')),
                ('score', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='score')),
                ('time_taken_s', models.DecimalField(blank=True, decimal_places=2, max_digits=6, null=True, verbose_name='time taken (s)')),
                ('notes_post', models.TextField(blank=True, verbose_name='post notes')),
                ('session', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stages', to='shooting_sessions.prssession', verbose_name='session')),
                ('shot_group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='prs_stages', to='tools.shotgroup', verbose_name='shot group')),
            ],
            options={
                'verbose_name': 'PRS stage',
                'verbose_name_plural': 'PRS stages',
                'ordering': ['order'],
            },
        ),
        migrations.CreateModel(
            name='FreePracticeSession',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, verbose_name='name')),
                ('date', models.DateField(verbose_name='date')),
                ('location', models.CharField(blank=True, max_length=255, verbose_name='location')),
                ('temperature_c', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True, verbose_name='temperature (°C)')),
                ('wind_speed_ms', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True, verbose_name='wind speed (m/s)')),
                ('wind_direction_deg', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='wind direction (°)')),
                ('humidity_pct', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='humidity (%)')),
                ('pressure_hpa', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True, verbose_name='pressure (hPa)')),
                ('weather_notes', models.TextField(blank=True, verbose_name='weather notes')),
                ('notes', models.TextField(blank=True, verbose_name='notes')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='updated at')),
                ('distance_m', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='distance (m)')),
                ('target_description', models.CharField(blank=True, max_length=255, verbose_name='target description')),
                ('rounds_fired', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='rounds fired')),
                ('ammo', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='gears.ammo', verbose_name='factory ammo')),
                ('reloaded_batch', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='gears.reloadedammobatch', verbose_name='reloaded batch')),
                ('rig', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='gears.rig', verbose_name='rig')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='user')),
            ],
            options={
                'verbose_name': 'free practice session',
                'verbose_name_plural': 'free practice sessions',
                'ordering': ['-date', '-created_at'],
                'abstract': False,
            },
        ),
        migrations.AddConstraint(
            model_name='prsstage',
            constraint=models.UniqueConstraint(fields=('session', 'order'), name='unique_prs_stage_order'),
        ),
    ]
