# Generated by Django 3.2.2 on 2021-05-08 09:43

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Beer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='created at')),
                ('name', models.CharField(max_length=255, verbose_name='beer name')),
                ('description', models.TextField(verbose_name='beer description')),
                ('mark', models.DecimalField(decimal_places=1, max_digits=3, verbose_name='beer mark')),
                ('price', models.DecimalField(decimal_places=2, help_text='Beer price in UAH', max_digits=5, verbose_name='beer price')),
                ('image', models.ImageField(upload_to=beer_app.models.image_upload_path, verbose_name='beer image')),
            ],
            options={
                'ordering': ['-updated_at'],
            },
        ),
        migrations.CreateModel(
            name='UserComment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='created at')),
                ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='created at')),
                ('mark', models.DecimalField(decimal_places=1, max_digits=3, verbose_name='beer mark')),
                ('text', models.TextField(blank=True)),
                ('beer', models.ForeignKey(help_text='shows for which beer this comment is', on_delete=django.db.models.deletion.CASCADE, related_name='user_comments', to='beer_app.beer')),
                ('owner', models.ForeignKey(help_text='owner of this mark', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-updated_at'],
                'unique_together': {('owner', 'beer')},
            },
        ),
    ]
