# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-27 04:47
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='Action',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time_created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Game',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('winning_team', models.CharField(blank=True, default=None, max_length=10, null=True)),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('time_started', models.DateTimeField(blank=True, default=None, null=True)),
                ('time_ended', models.DateTimeField(blank=True, default=None, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Hut',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position', models.IntegerField()),
                ('time_eliminated', models.DateTimeField(blank=True, default=None, null=True)),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='huts', to='api.Game')),
            ],
        ),
        migrations.CreateModel(
            name='Inquisition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('position', models.IntegerField()),
                ('time_created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('team', models.CharField(max_length=10)),
                ('position', models.IntegerField()),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('time_withdrawn', models.DateTimeField(blank=True, default=None, null=True)),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='players', to='api.Game')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Resident',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time_eliminated', models.DateTimeField(blank=True, default=None, null=True)),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='residents', to='api.Game')),
            ],
        ),
        migrations.CreateModel(
            name='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('role', models.CharField(max_length=20, unique=True)),
                ('team', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Turn',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.IntegerField()),
                ('current_phase', models.IntegerField(blank=True, default=1, null=True)),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('current_player', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='api.Player')),
                ('game', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='turns', to='api.Game')),
                ('grand_inquisitor', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='api.Player')),
            ],
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('time_removed', models.DateTimeField(blank=True, default=None, null=True)),
                ('hut', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='votes', to='api.Hut')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='votes', to='api.Player')),
                ('turn', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='votes', to='api.Turn')),
            ],
        ),
        migrations.AddField(
            model_name='resident',
            name='role',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='api.Role'),
        ),
        migrations.AddField(
            model_name='inquisition',
            name='resident',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='api.Resident'),
        ),
        migrations.AddField(
            model_name='inquisition',
            name='turn',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='inquisitions', to='api.Turn'),
        ),
        migrations.AddField(
            model_name='hut',
            name='resident',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='api.Resident'),
        ),
        migrations.AddField(
            model_name='game',
            name='active_turn',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='api.Turn'),
        ),
        migrations.AddField(
            model_name='game',
            name='owner',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='api.Player'),
        ),
        migrations.AddField(
            model_name='action',
            name='player',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='actions', to='api.Player'),
        ),
        migrations.AddField(
            model_name='action',
            name='resident',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='api.Resident'),
        ),
        migrations.AddField(
            model_name='action',
            name='turn',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='actions', to='api.Turn'),
        ),
    ]
