137 lines
7.3 KiB
Python
137 lines
7.3 KiB
Python
# Generated by Django 4.2.16 on 2026-03-24 09:48
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Gear',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('brand', models.CharField(max_length=100)),
|
|
('model_name', models.CharField(max_length=150)),
|
|
('description', models.TextField(blank=True)),
|
|
('gear_type', models.CharField(choices=[('FIREARM', 'Firearm'), ('SCOPE', 'Scope'), ('SUPPRESSOR', 'Suppressor'), ('BIPOD', 'Bipod'), ('MAGAZINE', 'Magazine')], editable=False, max_length=20)),
|
|
('status', models.CharField(choices=[('PENDING', 'Pending Verification'), ('VERIFIED', 'Verified'), ('REJECTED', 'Rejected')], default='PENDING', max_length=10)),
|
|
('reviewed_at', models.DateTimeField(blank=True, null=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
'ordering': ['brand', 'model_name'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Rig',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=100)),
|
|
('description', models.TextField(blank=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
'ordering': ['-created_at'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='RigItem',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('role', models.CharField(choices=[('PRIMARY', 'Primary Firearm'), ('OPTIC', 'Optic / Scope'), ('SUPPRESSOR', 'Suppressor'), ('BIPOD', 'Bipod'), ('MAGAZINE', 'Magazine'), ('OTHER', 'Other Accessory')], default='OTHER', max_length=20)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='Bipod',
|
|
fields=[
|
|
('gear_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='gears.gear')),
|
|
('min_height_mm', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True)),
|
|
('max_height_mm', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True)),
|
|
('attachment_type', models.CharField(blank=True, choices=[('PICATINNY', 'Picatinny Rail'), ('SLING_STUD', 'Sling Stud'), ('ARCA_SWISS', 'Arca-Swiss'), ('M_LOK', 'M-LOK'), ('KEYMOD', 'KeyMod')], max_length=20)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Bipod',
|
|
},
|
|
bases=('gears.gear',),
|
|
),
|
|
migrations.CreateModel(
|
|
name='Firearm',
|
|
fields=[
|
|
('gear_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='gears.gear')),
|
|
('firearm_type', models.CharField(choices=[('RIFLE', 'Rifle'), ('PISTOL', 'Pistol'), ('SHOTGUN', 'Shotgun'), ('REVOLVER', 'Revolver'), ('CARBINE', 'Carbine')], max_length=10)),
|
|
('caliber', models.CharField(max_length=20)),
|
|
('action', models.CharField(choices=[('BOLT', 'Bolt Action'), ('SEMI_AUTO', 'Semi-Automatic'), ('PUMP', 'Pump Action'), ('LEVER', 'Lever Action'), ('BREAK', 'Break Action'), ('FULL_AUTO', 'Full Automatic')], max_length=10)),
|
|
('barrel_length_mm', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True)),
|
|
('magazine_capacity', models.PositiveSmallIntegerField(blank=True, null=True)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Firearm',
|
|
},
|
|
bases=('gears.gear',),
|
|
),
|
|
migrations.CreateModel(
|
|
name='Magazine',
|
|
fields=[
|
|
('gear_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='gears.gear')),
|
|
('caliber', models.CharField(max_length=20)),
|
|
('capacity', models.PositiveSmallIntegerField()),
|
|
],
|
|
options={
|
|
'verbose_name': 'Magazine',
|
|
},
|
|
bases=('gears.gear',),
|
|
),
|
|
migrations.CreateModel(
|
|
name='Scope',
|
|
fields=[
|
|
('gear_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='gears.gear')),
|
|
('magnification_min', models.DecimalField(decimal_places=1, max_digits=5)),
|
|
('magnification_max', models.DecimalField(decimal_places=1, max_digits=5)),
|
|
('objective_diameter_mm', models.DecimalField(decimal_places=1, max_digits=5)),
|
|
('tube_diameter_mm', models.DecimalField(decimal_places=1, default=30, max_digits=5)),
|
|
('reticle_type', models.CharField(blank=True, choices=[('DUPLEX', 'Duplex'), ('MILDOT', 'Mil-Dot'), ('BDC', 'BDC'), ('ILLUMINATED', 'Illuminated'), ('ETCHED', 'Etched Glass')], max_length=20)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Scope',
|
|
},
|
|
bases=('gears.gear',),
|
|
),
|
|
migrations.CreateModel(
|
|
name='Suppressor',
|
|
fields=[
|
|
('gear_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='gears.gear')),
|
|
('max_caliber', models.CharField(max_length=20)),
|
|
('thread_pitch', models.CharField(blank=True, max_length=20)),
|
|
('length_mm', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True)),
|
|
('weight_g', models.DecimalField(blank=True, decimal_places=1, max_digits=6, null=True)),
|
|
],
|
|
options={
|
|
'verbose_name': 'Suppressor',
|
|
},
|
|
bases=('gears.gear',),
|
|
),
|
|
migrations.CreateModel(
|
|
name='UserGear',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('nickname', models.CharField(blank=True, max_length=100)),
|
|
('serial_number', models.CharField(blank=True, max_length=100)),
|
|
('purchase_date', models.DateField(blank=True, null=True)),
|
|
('notes', models.TextField(blank=True)),
|
|
('added_at', models.DateTimeField(auto_now_add=True)),
|
|
('gear', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_instances', to='gears.gear')),
|
|
],
|
|
options={
|
|
'ordering': ['-added_at'],
|
|
},
|
|
),
|
|
]
|