# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-26 01:36
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Beer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
                ('brewery', models.CharField(max_length=250)),
                ('style', models.CharField(max_length=250, null=True)),
                ('brewery_lat', models.FloatField(null=True)),
                ('brewery_lon', models.FloatField(null=True)),
                ('untappd_id', models.CharField(max_length=25, null=True)),
                ('last_updated', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Checkin',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('checkin_time', models.DateTimeField()),
                ('comment', models.CharField(max_length=250, null=True)),
                ('rating', models.IntegerField(default=-1)),
                ('untappd_checkin', models.URLField(max_length=250, null=True)),
                ('beer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beers.Beer')),
            ],
        ),
        migrations.CreateModel(
            name='Contest',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
                ('active', models.BooleanField(default=False)),
                ('created_on', models.DateTimeField()),
                ('last_updated', models.DateTimeField()),
                ('start_date', models.DateTimeField()),
                ('end_date', models.DateTimeField()),
                ('user_count', models.IntegerField()),
                ('beer_count', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Contest_Beer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('beer_name', models.CharField(max_length=250)),
                ('total_drank', models.IntegerField(verbose_name='number of players who drank this beer')),
                ('beer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beers.Beer')),
                ('contest', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beers.Contest')),
            ],
        ),
        migrations.CreateModel(
            name='Contest_Player',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_name', models.CharField(max_length=50)),
                ('beer_count', models.IntegerField(default=0)),
                ('last_checkin_date', models.DateTimeField(null=True, verbose_name='Denormalized date from last checkin')),
                ('last_checkin_beer', models.CharField(max_length=250, null=True, verbose_name='Denormalized beer name from last checkin')),
                ('contest', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beers.Contest')),
            ],
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('personal_statement', models.CharField(max_length=150)),
                ('untappd_rss', models.URLField(max_length=512, null=True)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='contest_player',
            name='player',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beers.Player'),
        ),
        migrations.AddField(
            model_name='checkin',
            name='player',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='beers.Player'),
        ),
    ]
