# Generated by Django 3.1 on 2022-12-25 10:50

import datetime
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import telegram_django_bot.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='max length 128', max_length=128)),
                ('is_visable', models.BooleanField(default=True)),
                ('info', models.TextField(blank=True, help_text='extra info about category', null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Entity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='max length 128', max_length=128)),
                ('is_visable', models.BooleanField(default=True)),
                ('price', models.DecimalField(decimal_places=2, max_digits=16)),
                ('author_id', models.PositiveIntegerField(help_text='write positive number')),
                ('used_material', models.FloatField(blank=True, help_text='float field', null=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='test_app.category')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Size',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='max length 128', max_length=128)),
                ('is_visable', models.BooleanField(default=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dttm_added', models.DateTimeField(auto_now_add=True)),
                ('info', models.TextField(blank=True, null=True)),
                ('status', models.CharField(choices=[('C', '✔️ ️Created'), ('W', '⏱ Waiting'), ('D', '✅ Completed')], max_length=32)),
                ('entities', models.ManyToManyField(blank=True, to='test_app.Entity')),
            ],
        ),
        migrations.CreateModel(
            name='EntitySizeAmount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.FloatField(default=0)),
                ('entity', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='test_app.entity')),
                ('size', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='test_app.size')),
            ],
        ),
        migrations.AddField(
            model_name='entity',
            name='sizes',
            field=models.ManyToManyField(blank=True, related_name='entities', through='test_app.EntitySizeAmount', to='test_app.Size'),
        ),
        migrations.CreateModel(
            name='BoughtItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.IntegerField(default=1)),
                ('price', models.DecimalField(decimal_places=2, max_digits=16)),
                ('entity_size', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='test_app.entitysizeamount')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='test_app.order')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('id', models.BigIntegerField(primary_key=True, serialize=False)),
                ('seed_code', models.IntegerField(default=telegram_django_bot.models._seed_code)),
                ('telegram_username', models.CharField(blank=True, max_length=64, null=True)),
                ('telegram_language_code', models.CharField(default='en', max_length=16)),
                ('timezone', models.DurationField(default=datetime.timedelta(seconds=10800))),
                ('current_utrl', models.CharField(blank=True, default='', max_length=64)),
                ('current_utrl_code_dttm', models.DateTimeField(blank=True, null=True)),
                ('current_utrl_context_db', models.CharField(blank=True, default='{}', max_length=4096)),
                ('current_utrl_form_db', models.CharField(blank=True, default='{}', max_length=4096)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
    ]
