Coverage for src/backend/InvenTree/build/migrations/0001_initial.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 17:47 +0000

1# Generated by Django 2.2 on 2019-05-20 12:04 

2 

3import django.core.validators 

4from django.db import migrations, models 

5import django.db.models.deletion 

6 

7 

8class Migration(migrations.Migration): 

9 

10 initial = True 

11 

12 dependencies = [ 

13 ] 

14 

15 operations = [ 

16 migrations.CreateModel( 

17 name='Build', 

18 fields=[ 

19 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 

20 ('title', models.CharField(help_text='Brief description of the build', max_length=100)), 

21 ('quantity', models.PositiveIntegerField(default=1, help_text='Number of parts to build', validators=[django.core.validators.MinValueValidator(1)])), 

22 ('status', models.PositiveIntegerField(choices=[(10, 'Pending'), (20, 'Allocated'), (30, 'Cancelled'), (40, 'Complete')], default=10, help_text='Build status', validators=[django.core.validators.MinValueValidator(0)])), 

23 ('batch', models.CharField(blank=True, help_text='Batch code for this build output', max_length=100, null=True)), 

24 ('creation_date', models.DateField(auto_now=True)), 

25 ('completion_date', models.DateField(blank=True, null=True)), 

26 ('URL', models.URLField(blank=True, help_text='Link to external URL')), 

27 ('notes', models.TextField(blank=True, help_text='Extra build notes')), 

28 ], 

29 ), 

30 migrations.CreateModel( 

31 name='BuildItem', 

32 fields=[ 

33 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), 

34 ('quantity', models.PositiveIntegerField(default=1, help_text='Stock quantity to allocate to build', validators=[django.core.validators.MinValueValidator(1)])), 

35 ('build', models.ForeignKey(help_text='Build to allocate parts', on_delete=django.db.models.deletion.CASCADE, related_name='allocated_stock', to='build.Build')), 

36 ], 

37 ), 

38 ]