# Generated by Django 3.0.8 on 2020-08-10 03:03

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


class Migration(migrations.Migration):

    dependencies = [
        ('mainapp', '0016_auto_20200809_2314'),
    ]

    operations = [
        migrations.CreateModel(
            name='ImageForArticle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('main_image', models.ImageField(blank=True, upload_to='static/article_img/')),
            ],
        ),
        migrations.CreateModel(
            name='ProductCompilation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=64, unique=True, verbose_name='название товара')),
                ('description', models.CharField(default='', max_length=256, verbose_name='описание товара')),
                ('image', models.ImageField(blank=True, upload_to='static/compilation_img/')),
                ('quantity', models.PositiveIntegerField(default=0, verbose_name='количество на складе')),
                ('discount', models.PositiveIntegerField(default=0, verbose_name='скидка на товар в процентах')),
                ('is_active', models.BooleanField(default=True, verbose_name='активен ли продукт')),
                ('product_list', models.ManyToManyField(related_name='compilation_items', to='mainapp.Product')),
            ],
        ),
        migrations.RemoveField(
            model_name='article',
            name='image',
        ),
        migrations.AddField(
            model_name='imageforarticle',
            name='article',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Article'),
        ),
    ]
