# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-25 14:49
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Game',
            fields=[
                ('event_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('date', models.DateTimeField(default=django.utils.timezone.now)),
                ('status', models.CharField(default='scheduled', max_length=255)),
            ],
            options={
                'db_table': 'game',
                'ordering': ['date'],
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('player_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('fname', models.CharField(max_length=255)),
                ('lname', models.CharField(max_length=255)),
            ],
            options={
                'db_table': 'player',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('team_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('wins', models.IntegerField(blank=True, null=True)),
                ('losses', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'team',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Venue',
            fields=[
                ('venue_id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('city', models.CharField(max_length=255, null=True)),
                ('capacity', models.IntegerField(null=True)),
                ('name', models.CharField(max_length=255, null=True)),
                ('zip', models.CharField(blank=True, max_length=255, null=True)),
                ('country', models.CharField(max_length=255, null=True)),
                ('state', models.CharField(blank=True, max_length=255, null=True)),
                ('address', models.CharField(max_length=255, null=True)),
            ],
            options={
                'db_table': 'venue',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Wagyr',
            fields=[
                ('wagyr_id', models.CharField(db_column='id', max_length=255, primary_key=True, serialize=False)),
                ('opponent_id', models.CharField(max_length=255, null=True)),
                ('amount', models.DecimalField(decimal_places=2, default=0, max_digits=6)),
                ('status', models.IntegerField(choices=[(1, 'In Progress'), (2, 'Pending Self'), (3, 'Pending Opponent'), (4, 'Fulfilled')], default=1)),
                ('self_team', models.CharField(blank=True, max_length=255, null=True)),
                ('opponent_team', models.CharField(blank=True, max_length=255, null=True)),
                ('game_id', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='game_wagyr', to='app.Game')),
                ('self_id', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='self_id_wagyr', to=settings.AUTH_USER_MODEL, to_field='username')),
                ('wagyr_winner', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.Wagyr')),
            ],
            options={
                'db_table': 'wagyr',
                'managed': True,
            },
        ),
        migrations.AddField(
            model_name='team',
            name='venue',
            field=models.OneToOneField(blank=True, db_column='venue', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='team_venue', to='app.Venue'),
        ),
        migrations.AddField(
            model_name='player',
            name='team',
            field=models.ForeignKey(db_column='team', on_delete=django.db.models.deletion.CASCADE, related_name='players', to='app.Team'),
        ),
        migrations.AddField(
            model_name='game',
            name='away_team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='away_team', to='app.Team'),
        ),
        migrations.AddField(
            model_name='game',
            name='home_team',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='home_team', to='app.Team'),
        ),
        migrations.AddField(
            model_name='game',
            name='venue',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='game_venue', to='app.Venue'),
        ),
    ]
