# Generated by Django 2.0.4 on 2018-04-23 14:20

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


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('inventory', '0002_auto_20180423_1407'),
    ]

    operations = [
        migrations.CreateModel(
            name='InventoryItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sku', models.CharField(db_index=True, max_length=75, unique=True)),
                ('object_id', models.PositiveIntegerField()),
                ('qty', models.PositiveIntegerField(default=0)),
                ('location', models.CharField(blank=True, max_length=50, null=True)),
                ('stock_comment', models.CharField(blank=True, max_length=255, null=True)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
        ),
        migrations.CreateModel(
            name='StockStatus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.CharField(blank=True, max_length=255, null=True)),
            ],
            options={
                'verbose_name_plural': 'Stock Status',
            },
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('transaction_type', models.PositiveIntegerField(choices=[(1, 'Received'), (2, 'Sold'), (3, 'Returned to Stock'), (4, 'Internal Transfer'), (5, 'Adjustment'), (6, 'Physical Count'), (7, 'Cycle Count'), (8, 'Scrapped')], db_index=True)),
                ('date', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('comment', models.CharField(blank=True, max_length=255, null=True)),
                ('object_id', models.PositiveIntegerField(blank=True, null=True)),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='TransactionItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qty', models.PositiveIntegerField(default=0)),
                ('unit_cost', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True)),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.InventoryItem')),
                ('transaction', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.Transaction')),
            ],
        ),
        migrations.RemoveField(
            model_name='inventory',
            name='location',
        ),
        migrations.RemoveField(
            model_name='inventorycheckpoint',
            name='inventory',
        ),
        migrations.RemoveField(
            model_name='inventorycpqty',
            name='check_point',
        ),
        migrations.RemoveField(
            model_name='inventorycpqty',
            name='supply',
        ),
        migrations.RemoveField(
            model_name='inventorytransaction',
            name='inventory',
        ),
        migrations.RemoveField(
            model_name='inventorytransaction',
            name='supply',
        ),
        migrations.RemoveField(
            model_name='log',
            name='content_type',
        ),
        migrations.RemoveField(
            model_name='payment',
            name='scheme',
        ),
        migrations.RemoveField(
            model_name='scheme',
            name='user',
        ),
        migrations.DeleteModel(
            name='Supplier',
        ),
        migrations.DeleteModel(
            name='Inventory',
        ),
        migrations.DeleteModel(
            name='InventoryCheckPoint',
        ),
        migrations.DeleteModel(
            name='InventoryCPQty',
        ),
        migrations.DeleteModel(
            name='InventoryTransaction',
        ),
        migrations.DeleteModel(
            name='ItemTemplate',
        ),
        migrations.DeleteModel(
            name='Location',
        ),
        migrations.DeleteModel(
            name='Log',
        ),
        migrations.DeleteModel(
            name='Payment',
        ),
        migrations.DeleteModel(
            name='Scheme',
        ),
        migrations.AddField(
            model_name='inventoryitem',
            name='stock_status',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='inventory.StockStatus'),
        ),
    ]
