# Generated by Django 2.0.2 on 2018-02-09 12:52

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='Role',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(db_column='name', max_length=200, unique=True, verbose_name='Role Name')),
                ('status', models.BooleanField(default=True)),
                ('next_role', models.ForeignKey(blank=True, db_column='next_role', default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='next_step', to='teamroles.Role', verbose_name='Next Role')),
                ('previous_role', models.ForeignKey(blank=True, db_column='previous_role', default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='previous_step', to='teamroles.Role', verbose_name='Previous Role')),
            ],
            options={
                'verbose_name': 'Role',
                'verbose_name_plural': 'Roles',
                'db_table': 'django_teams_role',
            },
        ),
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(db_column='name', max_length=100, verbose_name='Name')),
                ('code_name', models.CharField(db_column='codename', max_length=100, unique=True, verbose_name='Codename')),
            ],
            options={
                'verbose_name': 'Team',
                'verbose_name_plural': 'Teams',
                'db_table': 'django_teams_team',
            },
        ),
        migrations.CreateModel(
            name='UserRole',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teamroles.Role')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'User role',
                'verbose_name_plural': 'User roles',
                'db_table': 'django_teams_user_roles',
            },
        ),
        migrations.CreateModel(
            name='UserTeam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('team', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teamroles.Team')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'User team',
                'verbose_name_plural': 'User teams',
                'db_table': 'django_teams_user_teams',
            },
        ),
        migrations.AlterUniqueTogether(
            name='team',
            unique_together={('name', 'code_name')},
        ),
        migrations.AlterUniqueTogether(
            name='userteam',
            unique_together={('user', 'team')},
        ),
        migrations.AlterUniqueTogether(
            name='userrole',
            unique_together={('user', 'role')},
        ),
    ]
