# Generated by Django 3.2.4 on 2021-06-30 19:24

import autoslug.fields
import bgt_app.models
import datetime
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='DieGroup',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=40)),
            ],
            options={
                'verbose_name': 'Dice Group',
                'verbose_name_plural': 'Die Groups',
            },
        ),
        migrations.CreateModel(
            name='DrawBag',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=40)),
            ],
            options={
                'verbose_name': 'Draw Bag',
                'verbose_name_plural': 'Draw Bags',
            },
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=40)),
                ('color', models.CharField(choices=[('black', 'black'), ('white', 'white'), ('green', 'green'), ('blue', 'blue'), ('yellow', 'yellow'), ('purple', 'purple'), ('orange', 'orange'), ('red', 'red'), ('brown', 'brown')], default='black', max_length=10)),
                ('player_order', models.SmallIntegerField(default=0)),
                ('score', models.FloatField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(limit_value=-1000), django.core.validators.MaxValueValidator(limit_value=1000)])),
            ],
            options={
                'verbose_name': 'Player',
                'verbose_name_plural': 'Players',
            },
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'User Profile',
                'verbose_name_plural': 'User Profiles',
            },
        ),
        migrations.CreateModel(
            name='ToolSession',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='session_name', unique=True)),
                ('session_name', models.CharField(max_length=50)),
                ('creation_date', models.DateField(auto_now_add=True)),
                ('session_owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='bgt_app.userprofile')),
            ],
            options={
                'verbose_name': 'Tool Session',
                'verbose_name_plural': 'Tool Sessions',
            },
        ),
        migrations.CreateModel(
            name='ScoringGroup',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=40)),
                ('players', models.ManyToManyField(blank=True, default=None, related_name='scoring_groups', to='bgt_app.Player')),
                ('tool_session', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='scoring_groups', to='bgt_app.toolsession')),
            ],
            options={
                'verbose_name': 'Scoring Group',
                'verbose_name_plural': 'Scoring Groups',
            },
        ),
        migrations.CreateModel(
            name='ScoringCategory',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=40)),
                ('points_gained_or_lost', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(limit_value=-1000), django.core.validators.MaxValueValidator(limit_value=1000)])),
                ('items_per_group', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(limit_value=-1000), django.core.validators.MaxValueValidator(limit_value=1000)])),
                ('rounding', models.CharField(choices=[('up', 'round up'), ('down', 'round down'), ('none', 'no rounding')], default='none', max_length=5)),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='scoring_categories', to='bgt_app.scoringgroup')),
            ],
            options={
                'verbose_name': 'Scoring Category',
                'verbose_name_plural': 'Scoring Categories',
            },
        ),
        migrations.CreateModel(
            name='ResourceGroup',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=40)),
                ('tool_session', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='resource_groups', to='bgt_app.toolsession')),
            ],
            options={
                'verbose_name': 'Resource Group',
                'verbose_name_plural': 'Resource Groups',
            },
        ),
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=40)),
                ('image_name', models.CharField(default=None, max_length=15)),
                ('quantity', models.SmallIntegerField(default=0)),
                ('production_available', models.BooleanField(default=False)),
                ('production_modifier', models.SmallIntegerField(default=0)),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='bgt_app.resourcegroup')),
            ],
            options={
                'verbose_name': 'Resource',
                'verbose_name_plural': 'Resources',
            },
        ),
        migrations.AddField(
            model_name='player',
            name='tool_session',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='players', to='bgt_app.toolsession'),
        ),
        migrations.CreateModel(
            name='HpTracker',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=40)),
                ('hp_value', models.SmallIntegerField(default=0, validators=[django.core.validators.MinValueValidator(limit_value=-1000), django.core.validators.MaxValueValidator(limit_value=1000)])),
                ('tool_session', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='hp_tracker', to='bgt_app.toolsession')),
            ],
            options={
                'verbose_name': 'HP Tracker',
                'verbose_name_plural': 'HP Trackers',
            },
        ),
        migrations.CreateModel(
            name='GameTimer',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=40)),
                ('saved_duration', models.DurationField(default=datetime.timedelta(0))),
                ('tool_session', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='game_timers', to='bgt_app.toolsession')),
            ],
            options={
                'verbose_name': 'Game Timer',
                'verbose_name_plural': 'Game Timers',
            },
        ),
        migrations.CreateModel(
            name='DrawBagItem',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=40)),
                ('drawn', models.BooleanField(default=False)),
                ('drawn_datetime', models.DateTimeField(blank=True, null=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to=bgt_app.models.user_directory_path, validators=[django.core.validators.validate_image_file_extension, bgt_app.models.validate_image_file_size])),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='draw_bag_items', to='bgt_app.drawbag')),
            ],
            options={
                'verbose_name': 'Draw Bag Item',
                'verbose_name_plural': 'Draw Bag Items',
                'ordering': ['-drawn_datetime'],
            },
        ),
        migrations.AddField(
            model_name='drawbag',
            name='tool_session',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='draw_bag', to='bgt_app.toolsession'),
        ),
        migrations.CreateModel(
            name='DieStandard',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('num_sides', models.SmallIntegerField(default=6, validators=[django.core.validators.MinValueValidator(limit_value=2), django.core.validators.MaxValueValidator(limit_value=100)])),
                ('rolled_value', models.SmallIntegerField(default=0)),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='standard_dice', to='bgt_app.diegroup')),
            ],
            options={
                'verbose_name': 'Standard Die',
                'verbose_name_plural': 'Standard Dice',
                'ordering': ['num_sides'],
            },
        ),
        migrations.AddField(
            model_name='diegroup',
            name='tool_session',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='die_group', to='bgt_app.toolsession'),
        ),
    ]
