# Generated by Django 2.2.4 on 2019-08-03 20:56

import apps.poker.models
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='PokerMember',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, null=True, verbose_name='Name')),
                ('session', models.CharField(max_length=255, null=True, verbose_name='Session')),
            ],
            options={
                'verbose_name': 'Member',
                'verbose_name_plural': 'Members',
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='PokerRoom',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('token', models.CharField(default=apps.poker.models.generate_room_token, max_length=127, unique=True, verbose_name='Token')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('updated', models.DateTimeField(auto_now=True, verbose_name='Updated')),
            ],
            options={
                'verbose_name': 'Room',
                'verbose_name_plural': 'Rooms',
                'ordering': ('created',),
            },
        ),
        migrations.CreateModel(
            name='PokerRound',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255, null=True, verbose_name='name')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('completed', models.BooleanField(default=False, verbose_name='Completed')),
                ('room', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='rounds', to='poker.PokerRoom', verbose_name='Room')),
            ],
            options={
                'verbose_name': 'Round',
                'verbose_name_plural': 'Rounds',
                'ordering': ('created',),
            },
        ),
        migrations.CreateModel(
            name='PokerMemberVote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.IntegerField(default=0, null=True, verbose_name='Value')),
                ('member', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='votes', to='poker.PokerMember', verbose_name='Member')),
                ('poker_round', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='votes', to='poker.PokerRound', verbose_name='Poker round')),
            ],
            options={
                'verbose_name': 'Vote',
                'verbose_name_plural': 'Votes',
                'ordering': ('member',),
            },
        ),
        migrations.AddField(
            model_name='pokermember',
            name='room',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='members', to='poker.PokerRoom', verbose_name='Room'),
        ),
        migrations.AlterUniqueTogether(
            name='pokermember',
            unique_together={('room', 'session')},
        ),
    ]
