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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Caliber',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True, verbose_name='name')),
                ('short_name', models.CharField(blank=True, max_length=50, verbose_name='short name')),
                ('case_length_mm', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='case length (mm)')),
                ('overall_length_mm', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='overall length (mm)')),
                ('bullet_diameter_mm', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='bullet diameter (mm)')),
                ('case_head_diameter_mm', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='case head diameter (mm)')),
                ('rim_diameter_mm', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True, verbose_name='rim diameter (mm)')),
                ('max_pressure_mpa', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True, verbose_name='max pressure (MPa)')),
                ('notes', models.TextField(blank=True, verbose_name='notes')),
                ('status', models.CharField(
                    choices=[('PENDING', 'Pending Verification'), ('VERIFIED', 'Verified'), ('REJECTED', 'Rejected')],
                    default='PENDING',
                    max_length=10,
                    verbose_name='status',
                )),
                ('reviewed_at', models.DateTimeField(blank=True, null=True, verbose_name='reviewed at')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='updated at')),
                ('reviewed_by', models.ForeignKey(
                    blank=True,
                    null=True,
                    on_delete=django.db.models.deletion.SET_NULL,
                    related_name='reviewed_calibers',
                    to=settings.AUTH_USER_MODEL,
                    verbose_name='reviewed by',
                )),
                ('submitted_by', models.ForeignKey(
                    blank=True,
                    null=True,
                    on_delete=django.db.models.deletion.SET_NULL,
                    related_name='submitted_calibers',
                    to=settings.AUTH_USER_MODEL,
                    verbose_name='submitted by',
                )),
            ],
            options={
                'verbose_name': 'caliber',
                'verbose_name_plural': 'calibers',
                'ordering': ['name'],
            },
        ),
    ]
