# Generated by Django 3.1 on 2021-03-12 20:01

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Brand',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('brand_name', models.CharField(db_index=True, max_length=30, verbose_name='Бренд')),
                ('img_url', models.URLField(blank=True, null=True)),
            ],
            options={
                'verbose_name': 'Бренд',
                'verbose_name_plural': 'Бренд',
                'ordering': ['brand_name'],
            },
        ),
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('short_currency_name', models.CharField(db_index=True, max_length=3, verbose_name='Сокращенно')),
                ('currency_name', models.CharField(db_index=True, max_length=25, verbose_name='Валюта')),
            ],
            options={
                'verbose_name': 'Валюта',
                'verbose_name_plural': 'Валюта',
                'ordering': ['currency_name'],
            },
        ),
        migrations.CreateModel(
            name='Products',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('artno', models.CharField(db_index=True, max_length=25, verbose_name='Артикул')),
                ('name', models.CharField(db_index=True, max_length=200, verbose_name='Наименование')),
                ('price', models.PositiveIntegerField(verbose_name='Цена')),
                ('img_url', models.URLField(blank=True, null=True)),
                ('quantity', models.PositiveIntegerField(verbose_name='Количество складе')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Подробное описание')),
                ('tizer', models.TextField(blank=True, null=True, verbose_name='Краткое описание')),
                ('rating', models.PositiveIntegerField(verbose_name='Ретинг')),
                ('brand', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='products.brand', verbose_name='Бренд')),
            ],
        ),
        migrations.CreateModel(
            name='Properties',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('properties_name', models.CharField(db_index=True, max_length=25, verbose_name='Характеристика')),
            ],
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('unit_name', models.CharField(db_index=True, max_length=15, verbose_name='Единица измерения')),
            ],
            options={
                'verbose_name': 'Единица измерения',
                'verbose_name_plural': 'Единица измерения',
                'ordering': ['unit_name'],
            },
        ),
        migrations.CreateModel(
            name='Vendor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('vendor_name', models.CharField(db_index=True, max_length=90, verbose_name='Производитель')),
            ],
            options={
                'verbose_name': 'Производитель',
                'verbose_name_plural': 'Производитель',
                'ordering': ['vendor_name'],
            },
        ),
        migrations.CreateModel(
            name='Сategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category_name', models.CharField(db_index=True, max_length=90, verbose_name='Группы товара')),
            ],
            options={
                'verbose_name': 'Группы товара',
                'verbose_name_plural': 'Группы товара',
                'ordering': ['category_name'],
            },
        ),
        migrations.CreateModel(
            name='Сountry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('country_name', models.CharField(db_index=True, max_length=15, verbose_name='Страна производства')),
            ],
            options={
                'verbose_name': 'Страна производства',
                'verbose_name_plural': 'Страна производства',
                'ordering': ['country_name'],
            },
        ),
        migrations.CreateModel(
            name='PropertiesProducts',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('properties_value', models.CharField(db_index=True, max_length=25, verbose_name='Значение характеристики')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.products', verbose_name='Товар')),
                ('properties', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.properties', verbose_name='Характеристика')),
            ],
        ),
        migrations.AddField(
            model_name='properties',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='products.сategory', verbose_name='Группы товара'),
        ),
        migrations.AddField(
            model_name='products',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='products.сategory', verbose_name='Группы товара'),
        ),
        migrations.AddField(
            model_name='products',
            name='country_of_origin',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='products.сountry', verbose_name='Страна производства'),
        ),
        migrations.AddField(
            model_name='products',
            name='currency',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='products.currency', verbose_name='Валюта'),
        ),
        migrations.AddField(
            model_name='products',
            name='unit',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='products.unit', verbose_name='Единица измерения'),
        ),
        migrations.AddField(
            model_name='products',
            name='vendor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='products.vendor', verbose_name='Производитель'),
        ),
    ]
