# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-07-20 22:19
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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='BaseCustomUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(max_length=255, unique=True, verbose_name='email address')),
                ('country', models.CharField(max_length=2, verbose_name='country iso code')),
                ('province_or_state', models.CharField(blank=True, max_length=64, verbose_name='province or state')),
                ('city', models.CharField(blank=True, max_length=64, verbose_name='city')),
                ('first_name', models.CharField(max_length=128, verbose_name='first name')),
                ('last_name', models.CharField(max_length=128, verbose_name='last name')),
                ('date_of_birth', models.DateField(blank=True, null=True, verbose_name='date of birth')),
                ('newsletter', models.BooleanField(default=False, verbose_name='newsletter opt-in')),
                ('terms_conditions', models.BooleanField(default=False, verbose_name='terms and conditions agreement')),
                ('measuring_system', models.CharField(choices=[('metric', 'Metric'), ('imperial', 'Imperial')], default='metric', max_length=30, verbose_name='preferred measurind system')),
                ('profile_picture', models.ImageField(blank=True, null=True, upload_to='profile/', verbose_name='profile picture')),
                ('tagline', models.TextField(blank=True, max_length=500, verbose_name='tagline')),
                ('is_active', models.BooleanField(default=True, verbose_name='active')),
                ('is_staff', models.BooleanField(default=False, verbose_name='staff status')),
                ('is_admin', models.BooleanField(default=False, verbose_name='superuser')),
                ('jwt_last_expired', models.DateTimeField(default=django.utils.timezone.now)),
                ('user_type', models.CharField(choices=[('coach', 'Coach'), ('athlete', 'Athlete')], default='athlete', max_length=50, verbose_name='user type')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
            },
        ),
        migrations.CreateModel(
            name='Assessed',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Assessment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='assessment name')),
                ('description', models.CharField(blank=True, max_length=255, verbose_name='assessment description')),
            ],
        ),
        migrations.CreateModel(
            name='AssessmentFormat',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(blank=True, max_length=255, verbose_name='assessment format description')),
                ('unit', models.CharField(max_length=50, verbose_name='assessment format unit')),
                ('validation_regex', models.CharField(blank=True, max_length=500, null=True, verbose_name='assessment value validation regex')),
            ],
            options={
                'db_table': 'multidb_account_assessment_format',
            },
        ),
        migrations.CreateModel(
            name='AssessmentRelationshipType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(blank=True, max_length=255, verbose_name='assessment relationship type description')),
                ('type', models.CharField(max_length=50, verbose_name='assessment relationship type')),
            ],
            options={
                'db_table': 'multidb_account_assessment_relationship_type',
            },
        ),
        migrations.CreateModel(
            name='AssessmentSubCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='assessment category name')),
                ('description', models.CharField(blank=True, max_length=255, verbose_name='assessment category description')),
                ('parent_sub_category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='multidb_account.AssessmentSubCategory')),
            ],
            options={
                'db_table': 'multidb_account_assessment_sub_category',
            },
        ),
        migrations.CreateModel(
            name='AssessmentTopCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True, verbose_name='assessment top category name')),
                ('description', models.CharField(blank=True, max_length=255, verbose_name='assessment top category description')),
            ],
            options={
                'db_table': 'multidb_account_assessment_top_category',
            },
        ),
        migrations.CreateModel(
            name='AssessmentTopCategoryPermission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('assessor_has_access', models.BooleanField(default=False, verbose_name='assessor has access')),
                ('assessed', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.Assessed')),
                ('assessment_top_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.AssessmentTopCategory')),
            ],
            options={
                'db_table': 'multidb_account_assessment_top_category_permission',
            },
        ),
        migrations.CreateModel(
            name='Assessor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ChosenAssessment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_assessed', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date assessed')),
                ('value', models.DecimalField(decimal_places=6, max_digits=15, verbose_name='assessment value')),
                ('assessed', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.Assessed')),
                ('assessment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.Assessment')),
                ('assessor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.Assessor')),
            ],
            options={
                'db_table': 'multidb_account_chosen_assessment',
            },
        ),
        migrations.CreateModel(
            name='ChosenSport',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('is_chosen', models.BooleanField(default=False, verbose_name='is sport chosen on profile')),
                ('is_displayed', models.BooleanField(default=False, verbose_name='is sport displayed on profile')),
            ],
            options={
                'db_table': 'multidb_account_chosen_sport',
            },
        ),
        migrations.CreateModel(
            name='Coaching',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date_joined', models.DateField(default=django.utils.timezone.now, verbose_name='date joined')),
            ],
        ),
        migrations.CreateModel(
            name='Sport',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128, unique=True, verbose_name='sport name')),
                ('description', models.TextField(blank=True, max_length=500, verbose_name='sport description')),
                ('is_available', models.BooleanField(default=True, verbose_name='sport is available')),
            ],
        ),
        migrations.CreateModel(
            name='AthleteUser',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('referral_code', models.CharField(blank=True, max_length=255, verbose_name='referral_code')),
                ('athlete_terms_conditions', models.BooleanField(default=False, verbose_name='terms and conditions agreement')),
            ],
            options={
                'db_table': 'multidb_account_athlete_user',
            },
        ),
        migrations.CreateModel(
            name='CoachUser',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'multidb_account_coach_user',
            },
        ),
        migrations.AddField(
            model_name='sport',
            name='users',
            field=models.ManyToManyField(through='multidb_account.ChosenSport', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='chosensport',
            name='sport',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.Sport'),
        ),
        migrations.AddField(
            model_name='chosensport',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='assessmenttopcategorypermission',
            name='assessor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.Assessor'),
        ),
        migrations.AddField(
            model_name='assessmenttopcategory',
            name='sport',
            field=models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, to='multidb_account.Sport'),
        ),
        migrations.AddField(
            model_name='assessmentsubcategory',
            name='parent_top_category',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='multidb_account.AssessmentTopCategory'),
        ),
        migrations.AddField(
            model_name='assessment',
            name='format',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.AssessmentFormat'),
        ),
        migrations.AddField(
            model_name='assessment',
            name='parent_sub_category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.AssessmentSubCategory'),
        ),
        migrations.AddField(
            model_name='assessment',
            name='relationship_types',
            field=models.ManyToManyField(to='multidb_account.AssessmentRelationshipType'),
        ),
        migrations.AddField(
            model_name='assessed',
            name='assessments',
            field=models.ManyToManyField(through='multidb_account.ChosenAssessment', to='multidb_account.Assessment'),
        ),
        migrations.AddField(
            model_name='basecustomuser',
            name='groups',
            field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'),
        ),
        migrations.AddField(
            model_name='basecustomuser',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
        migrations.AddField(
            model_name='coaching',
            name='athlete',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.AthleteUser'),
        ),
        migrations.AddField(
            model_name='coaching',
            name='coach',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='multidb_account.CoachUser'),
        ),
        migrations.AddField(
            model_name='athleteuser',
            name='coaches',
            field=models.ManyToManyField(through='multidb_account.Coaching', to='multidb_account.CoachUser'),
        ),
        migrations.AddField(
            model_name='assessor',
            name='athlete',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multidb_account.AthleteUser'),
        ),
        migrations.AddField(
            model_name='assessor',
            name='coach',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multidb_account.CoachUser'),
        ),
        migrations.AddField(
            model_name='assessed',
            name='athlete',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multidb_account.AthleteUser'),
        ),
        migrations.AddField(
            model_name='assessed',
            name='coach',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='multidb_account.CoachUser'),
        ),
    ]
