# Generated by Django 2.1.3 on 2018-11-08 09:36

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('shop', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=80, verbose_name='название')),
                ('description', models.TextField(blank=True, verbose_name='описание')),
                ('slug', models.SlugField(unique=True, verbose_name='Слаг')),
                ('sort', models.PositiveSmallIntegerField(default=1, verbose_name='сортировка')),
                ('is_active', models.BooleanField(default=True, verbose_name='вкл/выкл')),
            ],
            options={
                'verbose_name': 'тип соревнования',
                'verbose_name_plural': 'типы соревнований',
            },
        ),
        migrations.CreateModel(
            name='Record',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.IntegerField(verbose_name='скорость вращения(пользователь)')),
                ('is_confirmed', models.BooleanField(default=False, verbose_name='подтверждён')),
                ('comment', models.TextField(blank=True, verbose_name='комментарий')),
                ('created_at', models.DateTimeField(default=datetime.datetime.now, editable=False, verbose_name='дата')),
                ('approved_at', models.DateTimeField(blank=True, editable=False, null=True, verbose_name='дата подтверждения')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='records', to='achievements.Category', verbose_name='категория')),
                ('powerball', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='records', to='shop.Product', verbose_name='модель')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='records', to=settings.AUTH_USER_MODEL, verbose_name='рекордсмен')),
            ],
            options={
                'verbose_name': 'рекорд',
                'verbose_name_plural': 'рекорды',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='RecordProof',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='uploads/achievements/', verbose_name='изображение')),
                ('record', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='proofs', to='achievements.Record', verbose_name='рекорд')),
            ],
            options={
                'verbose_name': 'картинка с рекордом',
                'verbose_name_plural': 'картинка с рекордами',
            },
        ),
    ]
