# Generated by Django 2.2.5 on 2019-09-24 21:35

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


class Migration(migrations.Migration):

    dependencies = [
        ('product', '0002_auto_20190923_2125'),
    ]

    operations = [
        migrations.CreateModel(
            name='BomTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(default='None', help_text='Unique code, only specified characters are allowed', max_length=50, unique=True)),
                ('name', models.CharField(default='None', help_text='Name, most characters are allowed', max_length=50)),
                ('description', models.TextField(default='None', help_text='Use short sentence to discribe your object', max_length=512)),
                ('created_by', models.CharField(default='auth.User', editable=False, max_length=50)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_by', models.CharField(default='auth.User', editable=False, max_length=50)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('revision', models.CharField(default='0', help_text='Revision number', max_length=20)),
                ('status', models.SmallIntegerField(choices=[('100', 'CREATE'), ('200', 'RELEASE'), ('300', 'DRAFT')], default=100, help_text='Status,very important for maintenance')),
            ],
            options={
                'verbose_name_plural': 'BOM template',
                'db_table': 'bom_template',
            },
        ),
        migrations.AlterModelOptions(
            name='material',
            options={'verbose_name_plural': 'Materials'},
        ),
        migrations.AlterModelOptions(
            name='product',
            options={'verbose_name_plural': 'Products'},
        ),
        migrations.CreateModel(
            name='ProductBOM',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_by', models.CharField(default='auth.User', editable=False, max_length=50)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_by', models.CharField(default='auth.User', editable=False, max_length=50)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('revision', models.CharField(default='0', help_text='Revision number', max_length=20)),
                ('status', models.SmallIntegerField(choices=[('100', 'CREATE'), ('200', 'RELEASE'), ('300', 'DRAFT')], default=100, help_text='Status,very important for maintenance')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='product.Product')),
            ],
            options={
                'verbose_name_plural': 'product BOM',
                'db_table': 'product_bom',
            },
        ),
        migrations.CreateModel(
            name='BomTemplateLine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_by', models.CharField(default='auth.User', editable=False, max_length=50)),
                ('created_on', models.DateTimeField(auto_now_add=True)),
                ('updated_by', models.CharField(default='auth.User', editable=False, max_length=50)),
                ('updated_on', models.DateTimeField(auto_now=True)),
                ('quantity', models.DecimalField(decimal_places=6, default=1, max_digits=20)),
                ('bom_template', models.ForeignKey(help_text='Please select existed bom template', on_delete=django.db.models.deletion.CASCADE, to='product.BomTemplate')),
                ('material', models.ForeignKey(help_text='Please select existed material', on_delete=django.db.models.deletion.CASCADE, to='product.Material')),
            ],
            options={
                'verbose_name_plural': 'BOM template',
                'db_table': 'bom_template_line',
            },
        ),
    ]
