# Generated by Django 2.0.1 on 2018-04-10 17:47

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default=None, max_length=24, null=True)),
            ],
            options={
                'verbose_name_plural': 'currencies',
                'verbose_name': 'currency',
            },
        ),
        migrations.CreateModel(
            name='ExchangeRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('at', models.DateField(verbose_name='on date')),
                ('value', models.DecimalField(decimal_places=4, default=0, max_digits=10)),
                ('base', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='base_currency', to='product.Currency')),
                ('quoted', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='quoted_currency', to='product.Currency')),
            ],
            options={
                'verbose_name_plural': 'quotations',
                'verbose_name': 'quotation',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('seo_title', models.CharField(blank=True, max_length=250, verbose_name='Title')),
                ('seo_description', models.CharField(blank=True, max_length=250, verbose_name='Description')),
                ('seo_keywords', models.CharField(blank=True, max_length=250, verbose_name='Keywords')),
                ('name', models.CharField(blank=True, default=None, max_length=64, null=True)),
                ('in_stock', models.IntegerField(default=1)),
                ('discount', models.IntegerField(default=0)),
                ('description', models.TextField(blank=True, default=None, null=True)),
                ('short_description', models.TextField(blank=True, default=None, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name_plural': 'Products',
                'verbose_name': 'Product',
            },
        ),
        migrations.CreateModel(
            name='Product_image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='static/media/products_images/')),
                ('is_active', models.BooleanField(default=True)),
                ('is_main', models.BooleanField(default=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('product', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.Product')),
            ],
            options={
                'verbose_name_plural': 'Photos',
                'verbose_name': 'Photo',
            },
        ),
        migrations.CreateModel(
            name='Product_price',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='product.Currency', verbose_name='Currency')),
                ('product', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='product.Product', verbose_name='Product')),
            ],
            options={
                'verbose_name_plural': 'current prices',
                'verbose_name': 'current price',
            },
        ),
        migrations.CreateModel(
            name='ProductCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default=None, max_length=64, null=True)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name_plural': 'Product categories',
                'verbose_name': 'Product category',
            },
        ),
        migrations.CreateModel(
            name='ProductSubcategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default=None, max_length=64, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('category', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.ProductCategory')),
            ],
            options={
                'verbose_name_plural': 'Product subcategories',
                'verbose_name': 'Product subcategory',
            },
        ),
        migrations.AddField(
            model_name='product',
            name='category',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.ProductCategory'),
        ),
        migrations.AddField(
            model_name='product',
            name='subcategory',
            field=models.ManyToManyField(blank=True, default=None, to='product.ProductSubcategory'),
        ),
    ]
