# Generated by Django 2.1.1 on 2018-11-07 10:38

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('categories', '0002_auto_20181107_1505'),
        ('companies', '0007_companyadmin_full_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(blank=True, max_length=100, null=True)),
                ('name', models.CharField(error_messages={'max_length': 'Length Shouldnot be longer than 120 characters'}, max_length=120)),
                ('description', models.TextField()),
                ('available', models.BooleanField(default=True)),
                ('featured', models.BooleanField(default=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='items', to='categories.Category')),
                ('provider', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='items', to='companies.Company')),
            ],
            options={
                'db_table': 'items_item',
            },
        ),
        migrations.CreateModel(
            name='StockRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('price_excl_tax', models.DecimalField(decimal_places=2, max_digits=19)),
                ('discounted_percentage', models.DecimalField(decimal_places=2, max_digits=19)),
                ('discounted_price', models.DecimalField(decimal_places=2, max_digits=19)),
                ('quantity', models.PositiveIntegerField()),
                ('is_deleted', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.DO_NOTHING, related_name='stock_record', to='items.Item')),
            ],
            options={
                'verbose_name': 'Stock Record',
                'verbose_name_plural': 'Stock Records ',
                'db_table': 'items_stock_record',
            },
        ),
        migrations.AlterIndexTogether(
            name='item',
            index_together={('id', 'slug')},
        ),
    ]
