# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-27 17:54
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('players', '0001_initial'),
        ('teams', '0001_initial'),
        ('common', '0003_teammemberhistory'),
    ]

    operations = [
        migrations.CreateModel(
            name='Application',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated', models.DateTimeField(blank=True, editable=False, null=True)),
                ('status', models.IntegerField(choices=[(1, 'Pending'), (2, 'Accepted'), (3, 'Rejected'), (4, 'Expired'), (5, 'Withdrawn')], default=1, verbose_name='Status')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='players.Player')),
                ('position', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='common.Position')),
                ('team', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teams.Team')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ApplicationStatusHistory',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated', models.DateTimeField(blank=True, editable=False, null=True)),
                ('status', models.IntegerField(choices=[(1, 'Pending'), (2, 'Accepted'), (3, 'Rejected'), (4, 'Expired'), (5, 'Withdrawn')], verbose_name='Status')),
                ('application', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='common.Application')),
            ],
            options={
                'abstract': False,
                'ordering': ('-created',),
            },
        ),
        migrations.CreateModel(
            name='Invitation',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated', models.DateTimeField(blank=True, editable=False, null=True)),
                ('status', models.IntegerField(choices=[(1, 'Pending'), (2, 'Accepted'), (3, 'Rejected'), (4, 'Expired'), (5, 'Withdrawn')], default=1, verbose_name='Status')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='invitations_created', to='players.Player')),
                ('player', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='players.Player')),
                ('position', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='common.Position')),
                ('team', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teams.Team')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='InvitationStatusHistory',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated', models.DateTimeField(blank=True, editable=False, null=True)),
                ('status', models.IntegerField(choices=[(1, 'Pending'), (2, 'Accepted'), (3, 'Rejected'), (4, 'Expired'), (5, 'Withdrawn')], verbose_name='Status')),
                ('invitation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='common.Invitation')),
            ],
            options={
                'abstract': False,
                'ordering': ('-created',),
            },
        ),
        migrations.AlterModelOptions(
            name='teammember',
            options={'ordering': ('team', 'player')},
        ),
    ]
