# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-19 14:45
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
import stuff.fields
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('users', '0002_ci_fields'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Squad',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256, verbose_name='squad name')),
                ('tag', stuff.fields.CaseInsensitiveCharField(max_length=16, verbose_name='squad tag')),
                ('website', models.URLField(blank=True, verbose_name='website')),
                ('about', models.TextField(blank=True, verbose_name='about squad')),
                ('join_code', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('is_removed', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name_plural': 'squads',
                'verbose_name': 'squad',
                'db_table': 'squads',
            },
        ),
        migrations.CreateModel(
            name='SquadMember',
            fields=[
                ('member', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('is_admin', models.BooleanField(default=False)),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('squad', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='squads.Squad')),
            ],
            options={
                'verbose_name_plural': 'squads members',
                'verbose_name': 'squad member',
                'db_table': 'squads_members',
            },
        ),
        migrations.AddField(
            model_name='squad',
            name='members',
            field=models.ManyToManyField(through='squads.SquadMember', to=settings.AUTH_USER_MODEL),
        ),
    ]
