# Generated by Django 3.2 on 2021-10-03 20:31

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('account', '0002_auto_20211003_2031'),
    ]

    operations = [
        migrations.CreateModel(
            name='Color',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=160, null=True, verbose_name='color')),
            ],
        ),
        migrations.CreateModel(
            name='Products',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.CharField(blank=True, choices=[('MOBILE', 'mobile'), ('TABLET', 'tablet'), ('CLOTHES', 'clothes')], max_length=150, null=True, verbose_name='code type')),
                ('name', models.CharField(max_length=250, verbose_name='name')),
                ('quantity', models.PositiveIntegerField(default=0, verbose_name='quantity')),
                ('image', models.ImageField(blank=True, default='products/default.png', null=True, upload_to=product.models.upload_to, verbose_name='image')),
                ('slug', models.SlugField(null=True, unique=True)),
                ('price', models.PositiveIntegerField(verbose_name='(price')),
                ('published', models.DateTimeField(auto_now_add=True, verbose_name='create time')),
                ('available', models.BooleanField(default=True, verbose_name='available')),
                ('modified_time', models.DateTimeField(auto_now=True, verbose_name='updated_time')),
                ('description', models.TextField(blank=True, max_length=10000, verbose_name='description')),
                ('discount', models.PositiveIntegerField(blank=True, null=True)),
                ('option_status', models.CharField(blank=True, choices=[('None', 'None'), ('color', 'color'), ('size', 'size')], default='None', max_length=150, null=True)),
                ('like_count', models.BigIntegerField(default='0')),
                ('color', models.ManyToManyField(blank=True, related_name='color', related_query_name='color', to='product.Color')),
                ('favourites', models.ManyToManyField(blank=True, default=None, related_name='favourite', to='account.CustomUSer')),
                ('likes', models.ManyToManyField(blank=True, default=None, related_name='like', to='account.CustomUSer')),
            ],
        ),
        migrations.CreateModel(
            name='Size',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=50, null=True, verbose_name='size')),
            ],
        ),
        migrations.CreateModel(
            name='variants',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, verbose_name='name')),
                ('unit_price', models.PositiveIntegerField(verbose_name='unit-price')),
                ('discount', models.PositiveIntegerField(blank=True, null=True)),
                ('amount', models.PositiveIntegerField(default=1, verbose_name='amount')),
                ('color_variant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.color')),
                ('product_variant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='variants', to='product.products')),
                ('size_variant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='product.size', verbose_name='size')),
            ],
        ),
        migrations.AddField(
            model_name='products',
            name='size',
            field=models.ManyToManyField(blank=True, related_query_name='size', to='product.Size'),
        ),
    ]
