# Generated by Django 3.0.6 on 2020-05-18 01:03

from decimal import Decimal
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Dice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number_of_faces', models.PositiveSmallIntegerField(default=6, verbose_name='Number of faces')),
            ],
            options={
                'verbose_name': 'Dice',
                'verbose_name_plural': 'Dices',
            },
        ),
        migrations.CreateModel(
            name='Match',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'verbose_name': 'Match',
                'verbose_name_plural': 'Matches',
            },
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('behavior', models.CharField(choices=[('impulsive', 'Impulsive'), ('picky', 'Picky'), ('conservative', 'Conservative'), ('random', 'Random')], max_length=12, verbose_name='behavior')),
                ('name', models.CharField(max_length=80, verbose_name='name')),
                ('account_balance', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='account')),
                ('order', models.PositiveSmallIntegerField(verbose_name='order')),
                ('is_winner', models.NullBooleanField(default=None, verbose_name='Winner')),
                ('match', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Match')),
            ],
            options={
                'verbose_name': 'Player',
                'verbose_name_plural': 'Players',
            },
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=80, verbose_name='name')),
                ('rent_price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='rent price')),
                ('sale_price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='sale price')),
                ('order', models.PositiveSmallIntegerField(verbose_name='order')),
                ('match', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Match')),
                ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Player')),
            ],
            options={
                'verbose_name': 'Property',
                'verbose_name_plural': 'Properties',
            },
        ),
        migrations.CreateModel(
            name='Turn',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dice_result', models.PositiveSmallIntegerField(verbose_name='dice result')),
                ('match', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Match')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Player')),
                ('property', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Property')),
            ],
            options={
                'verbose_name': 'Turn',
                'verbose_name_plural': 'Turns',
            },
        ),
        migrations.CreateModel(
            name='TurnAccountMovement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='account movement')),
                ('turn', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Turn')),
            ],
            options={
                'verbose_name': 'Turn account movement',
                'verbose_name_plural': 'Turns account movements',
            },
        ),
        migrations.CreateModel(
            name='Simulation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number_of_properties', models.PositiveSmallIntegerField(default=20, verbose_name='number os properties')),
                ('number_of_players', models.PositiveSmallIntegerField(default=4, verbose_name='number os players')),
                ('max_turns', models.PositiveSmallIntegerField(default=1000, verbose_name='limit of turns')),
                ('initial_account_balance', models.DecimalField(decimal_places=2, default=Decimal('300.00'), max_digits=8, verbose_name="initial player's account")),
                ('times_to_run', models.PositiveSmallIntegerField(default=300, verbose_name='times to run')),
                ('alias', models.CharField(blank=True, max_length=80, verbose_name='alias')),
                ('dice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Dice')),
            ],
            options={
                'verbose_name': 'Simulation',
                'verbose_name_plural': 'Simulations',
            },
        ),
        migrations.AddField(
            model_name='match',
            name='simulation',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Simulation'),
        ),
        migrations.AddConstraint(
            model_name='property',
            constraint=models.UniqueConstraint(fields=('match', 'order'), name='property-match-order'),
        ),
        migrations.AddConstraint(
            model_name='player',
            constraint=models.UniqueConstraint(fields=('match', 'order'), name='player-match-order'),
        ),
    ]

# Generated by Django 3.0.6 on 2020-05-18 01:03

from decimal import Decimal
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Dice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number_of_faces', models.PositiveSmallIntegerField(default=6, verbose_name='Number of faces')),
            ],
            options={
                'verbose_name': 'Dice',
                'verbose_name_plural': 'Dices',
            },
        ),
        migrations.CreateModel(
            name='Match',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'verbose_name': 'Match',
                'verbose_name_plural': 'Matches',
            },
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('behavior', models.CharField(choices=[('impulsive', 'Impulsive'), ('picky', 'Picky'), ('conservative', 'Conservative'), ('random', 'Random')], max_length=12, verbose_name='behavior')),
                ('name', models.CharField(max_length=80, verbose_name='name')),
                ('account_balance', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='account')),
                ('order', models.PositiveSmallIntegerField(verbose_name='order')),
                ('is_winner', models.NullBooleanField(default=None, verbose_name='Winner')),
                ('match', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Match')),
            ],
            options={
                'verbose_name': 'Player',
                'verbose_name_plural': 'Players',
            },
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=80, verbose_name='name')),
                ('rent_price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='rent price')),
                ('sale_price', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='sale price')),
                ('order', models.PositiveSmallIntegerField(verbose_name='order')),
                ('match', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Match')),
                ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Player')),
            ],
            options={
                'verbose_name': 'Property',
                'verbose_name_plural': 'Properties',
            },
        ),
        migrations.CreateModel(
            name='Turn',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dice_result', models.PositiveSmallIntegerField(verbose_name='dice result')),
                ('match', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Match')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Player')),
                ('property', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Property')),
            ],
            options={
                'verbose_name': 'Turn',
                'verbose_name_plural': 'Turns',
            },
        ),
        migrations.CreateModel(
            name='TurnAccountMovement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.DecimalField(decimal_places=2, max_digits=8, verbose_name='account movement')),
                ('turn', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Turn')),
            ],
            options={
                'verbose_name': 'Turn account movement',
                'verbose_name_plural': 'Turns account movements',
            },
        ),
        migrations.CreateModel(
            name='Simulation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number_of_properties', models.PositiveSmallIntegerField(default=20, verbose_name='number os properties')),
                ('number_of_players', models.PositiveSmallIntegerField(default=4, verbose_name='number os players')),
                ('max_turns', models.PositiveSmallIntegerField(default=1000, verbose_name='limit of turns')),
                ('initial_account_balance', models.DecimalField(decimal_places=2, default=Decimal('300.00'), max_digits=8, verbose_name="initial player's account")),
                ('times_to_run', models.PositiveSmallIntegerField(default=300, verbose_name='times to run')),
                ('alias', models.CharField(blank=True, max_length=80, verbose_name='alias')),
                ('dice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Dice')),
            ],
            options={
                'verbose_name': 'Simulation',
                'verbose_name_plural': 'Simulations',
            },
        ),
        migrations.AddField(
            model_name='match',
            name='simulation',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Simulation'),
        ),
        migrations.AddConstraint(
            model_name='property',
            constraint=models.UniqueConstraint(fields=('match', 'order'), name='property-match-order'),
        ),
        migrations.AddConstraint(
            model_name='player',
            constraint=models.UniqueConstraint(fields=('match', 'order'), name='player-match-order'),
        ),
    ]

# Generated by Django 3.0.6 on 2020-05-18 01:03