Rebuilt migrations again (arrrrrrrrrrrrrrrrrrrrrrrrrrgh never do this)

This commit is contained in:
Oliver Walters 2019-05-20 21:45:37 +10:00
parent 34620b22b0
commit 70be052c74
8 changed files with 57 additions and 24 deletions

View File

@ -1,6 +1,5 @@
# Generated by Django 2.2 on 2019-05-18 14:04 # Generated by Django 2.2 on 2019-05-20 09:22
from django.conf import settings
import django.core.validators import django.core.validators
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
@ -11,9 +10,6 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
('part', '0002_auto_20190519_0004'),
('stock', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
@ -29,9 +25,6 @@ class Migration(migrations.Migration):
('completion_date', models.DateField(blank=True, null=True)), ('completion_date', models.DateField(blank=True, null=True)),
('URL', models.URLField(blank=True, help_text='Link to external URL')), ('URL', models.URLField(blank=True, help_text='Link to external URL')),
('notes', models.TextField(blank=True, help_text='Extra build notes')), ('notes', models.TextField(blank=True, help_text='Extra build notes')),
('completed_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='builds_completed', to=settings.AUTH_USER_MODEL)),
('part', models.ForeignKey(help_text='Select part to build', limit_choices_to={'active': True, 'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='builds', to='part.Part')),
('take_from', models.ForeignKey(blank=True, help_text='Select location to take stock from for this build (leave blank to take from any stock location)', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sourcing_builds', to='stock.StockLocation')),
], ],
), ),
migrations.CreateModel( migrations.CreateModel(
@ -40,10 +33,6 @@ class Migration(migrations.Migration):
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('quantity', models.PositiveIntegerField(default=1, help_text='Stock quantity to allocate to build', validators=[django.core.validators.MinValueValidator(1)])), ('quantity', models.PositiveIntegerField(default=1, help_text='Stock quantity to allocate to build', validators=[django.core.validators.MinValueValidator(1)])),
('build', models.ForeignKey(help_text='Build to allocate parts', on_delete=django.db.models.deletion.CASCADE, related_name='allocated_stock', to='build.Build')), ('build', models.ForeignKey(help_text='Build to allocate parts', on_delete=django.db.models.deletion.CASCADE, related_name='allocated_stock', to='build.Build')),
('stock_item', models.ForeignKey(help_text='Stock Item to allocate to build', on_delete=django.db.models.deletion.CASCADE, related_name='allocations', to='stock.StockItem')),
], ],
options={
'unique_together': {('build', 'stock_item')},
},
), ),
] ]

View File

@ -0,0 +1,44 @@
# Generated by Django 2.2 on 2019-05-20 09:22
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('stock', '0001_initial'),
('part', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('build', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='builditem',
name='stock_item',
field=models.ForeignKey(help_text='Stock Item to allocate to build', on_delete=django.db.models.deletion.CASCADE, related_name='allocations', to='stock.StockItem'),
),
migrations.AddField(
model_name='build',
name='completed_by',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='builds_completed', to=settings.AUTH_USER_MODEL),
),
migrations.AddField(
model_name='build',
name='part',
field=models.ForeignKey(help_text='Select part to build', limit_choices_to={'active': True, 'buildable': True}, on_delete=django.db.models.deletion.CASCADE, related_name='builds', to='part.Part'),
),
migrations.AddField(
model_name='build',
name='take_from',
field=models.ForeignKey(blank=True, help_text='Select location to take stock from for this build (leave blank to take from any stock location)', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sourcing_builds', to='stock.StockLocation'),
),
migrations.AlterUniqueTogether(
name='builditem',
unique_together={('build', 'stock_item')},
),
]

View File

@ -1,4 +1,4 @@
# Generated by Django 2.2 on 2019-05-18 14:04 # Generated by Django 2.2 on 2019-05-20 09:22
import company.models import company.models
import django.core.validators import django.core.validators

View File

@ -1,4 +1,4 @@
# Generated by Django 2.2 on 2019-05-18 14:04 # Generated by Django 2.2 on 2019-05-20 09:22
from django.db import migrations, models from django.db import migrations, models
import django.db.models.deletion import django.db.models.deletion
@ -9,8 +9,8 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
('company', '0001_initial'),
('part', '0001_initial'), ('part', '0001_initial'),
('company', '0001_initial'),
] ]
operations = [ operations = [

View File

@ -1,4 +1,4 @@
# Generated by Django 2.2 on 2019-05-18 14:04 # Generated by Django 2.2 on 2019-05-20 09:22
import InvenTree.validators import InvenTree.validators
from django.conf import settings from django.conf import settings

View File

@ -1,4 +1,4 @@
# Generated by Django 2.2 on 2019-05-18 14:04 # Generated by Django 2.2 on 2019-05-20 09:22
from django.conf import settings from django.conf import settings
from django.db import migrations, models from django.db import migrations, models
@ -10,10 +10,10 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
('company', '0002_auto_20190519_0004'), ('company', '0002_auto_20190520_1922'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('stock', '0001_initial'), ('stock', '0001_initial'),
('part', '0001_initial'), ('part', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [

View File

@ -1,4 +1,4 @@
# Generated by Django 2.2 on 2019-05-18 14:04 # Generated by Django 2.2 on 2019-05-20 09:22
from django.conf import settings from django.conf import settings
import django.core.validators import django.core.validators
@ -11,9 +11,9 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('company', '0001_initial'),
('part', '0001_initial'), ('part', '0001_initial'),
('company', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
] ]
operations = [ operations = [
@ -70,7 +70,7 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name='stockitem', model_name='stockitem',
name='part', name='part',
field=models.ForeignKey(help_text='Base part', on_delete=django.db.models.deletion.CASCADE, related_name='locations', to='part.Part'), field=models.ForeignKey(help_text='Base part', on_delete=django.db.models.deletion.CASCADE, related_name='stock_items', to='part.Part'),
), ),
migrations.AddField( migrations.AddField(
model_name='stockitem', model_name='stockitem',

View File

@ -186,7 +186,7 @@ class StockItem(models.Model):
} }
) )
part = models.ForeignKey('part.Part', on_delete=models.CASCADE, related_name='locations', help_text='Base part') part = models.ForeignKey('part.Part', on_delete=models.CASCADE, related_name='stock_items', help_text='Base part')
supplier_part = models.ForeignKey('company.SupplierPart', blank=True, null=True, on_delete=models.SET_NULL, supplier_part = models.ForeignKey('company.SupplierPart', blank=True, null=True, on_delete=models.SET_NULL,
help_text='Select a matching supplier part for this stock item') help_text='Select a matching supplier part for this stock item')