# Generated by Django 4.1 on 2024-04-22 12:20

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.CharField(db_index=True, max_length=50, primary_key=True, serialize=False, unique=True, verbose_name='ID Категории')),
                ('title', models.CharField(max_length=50, verbose_name='Название Категории')),
                ('image', models.ImageField(upload_to='', verbose_name='Картинка категории')),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='ID Товара')),
                ('title', models.CharField(max_length=50, verbose_name='Название Товара')),
                ('description', models.TextField(max_length=300, verbose_name='Описание товара')),
                ('price', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(999)], verbose_name='Цена товара')),
                ('tags', models.TextField(max_length=300, verbose_name="Теги (Указывать через разделитель '|')")),
                ('icons', models.ImageField(upload_to='', verbose_name='Иконка товара')),
                ('date', models.DateTimeField(auto_now=True, verbose_name='Дата создания товара')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SusMarketBackend.category')),
            ],
            options={
                'verbose_name': 'Товар',
                'verbose_name_plural': 'Товары',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='ID Пользователя')),
                ('login', models.CharField(max_length=50, verbose_name='Логин')),
                ('password', models.TextField(max_length=200, verbose_name='Пароль')),
                ('date', models.DateTimeField(auto_now=True, verbose_name='Дата создания пользователя')),
            ],
            options={
                'verbose_name': 'Пользователь',
                'verbose_name_plural': 'Пользователи',
            },
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.AutoField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='ID Отзыва')),
                ('commentary', models.TextField(max_length=300, verbose_name='Комментарий отзыва')),
                ('rate', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)], verbose_name='Оценка')),
                ('icons', models.ImageField(null=True, upload_to='', verbose_name='Изображение отзыва')),
                ('date', models.DateTimeField(auto_now=True, verbose_name='Дата создания отзыва')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SusMarketBackend.product')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SusMarketBackend.user')),
            ],
            options={
                'verbose_name': 'Отзыв',
                'verbose_name_plural': 'Отзывы',
            },
        ),
    ]
