# Generated by Django 3.2.6 on 2021-08-09 11:29

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Ammo',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='The common name of the part.', max_length=50)),
                ('weight', models.IntegerField(default=0, help_text='The weight of the part.')),
            ],
        ),
        migrations.CreateModel(
            name='AmmoItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('unit_type', models.CharField(choices=[('G', 'Ground Combat Element'), ('N', 'Non-Ground Combat Element')], default='G', max_length=1)),
                ('base_allocation', models.PositiveIntegerField(default=0, help_text='The base combat load for this weapon and ammo combination.')),
                ('daily_assault', models.PositiveIntegerField(default=0, help_text='The daily sustainment quantity.')),
                ('daily_sustain', models.PositiveIntegerField(default=0, help_text='The daily sustainment quantity.')),
                ('ammo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exercise.ammo')),
            ],
        ),
        migrations.CreateModel(
            name='CombatLoad',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ammoitem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exercise.ammoitem')),
            ],
        ),
        migrations.CreateModel(
            name='Equipment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='The common name of the equipment.', max_length=50)),
                ('fuel_capacity', models.IntegerField(default=0, help_text='The total fuel capacity in gallons.')),
                ('burn_rate', models.FloatField(default=0, help_text='The burn rate of fuel in gal/h.')),
                ('weight', models.FloatField(default=0, help_text='The weight of the equipment in pounds.')),
                ('combat_loads', models.ManyToManyField(help_text='A list of equipment ammo that this equipment contains.', through='exercise.CombatLoad', to='exercise.AmmoItem')),
            ],
        ),
        migrations.CreateModel(
            name='EquipmentItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phasing_location', models.CharField(choices=[('AE', 'Assault Element'), ('AFOE', 'Assault Follow-On Element')], default='AE', help_text='The location of the item in relation to the phasing.', max_length=4)),
                ('quantity', models.PositiveIntegerField(default=0, help_text='The quantity of an item.')),
                ('equipment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exercise.equipment')),
            ],
        ),
        migrations.CreateModel(
            name='Exercise',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
            ],
            options={
                'base_manager_name': 'objects',
            },
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='The name of the unit.', max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='ExerciseEdl',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('equipment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='gear', to='exercise.equipmentitem')),
                ('exercise', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exercise.exercise')),
                ('unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exercise.unit')),
            ],
        ),
        migrations.AddField(
            model_name='exercise',
            name='equipments',
            field=models.ManyToManyField(through='exercise.ExerciseEdl', to='exercise.EquipmentItem'),
        ),
        migrations.AddField(
            model_name='exercise',
            name='units',
            field=models.ManyToManyField(to='exercise.Unit'),
        ),
        migrations.AddField(
            model_name='combatload',
            name='equipment',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='exercise.equipment'),
        ),
    ]
