# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-02 01:58
from __future__ import unicode_literals

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import guru_api.core.models.account
import guru_api.core.upload_paths


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Account',
            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')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('is_active', models.BooleanField(default=True)),
                ('is_verified', models.BooleanField(default=False)),
                ('is_staff', models.BooleanField(default=False)),
                ('account_type', models.PositiveSmallIntegerField(choices=[(1, b'User'), (2, b'Organization')], default=1)),
                ('jwt_secret_key', models.CharField(default=guru_api.core.models.account._generate_jwt_secret_key, editable=False, max_length=30)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CourseListing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('title', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True, null=True)),
                ('cancellation_fee', models.DecimalField(blank=True, decimal_places=2, default=0, max_digits=9)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CourseSession',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('date', models.DateTimeField()),
                ('paid', models.BooleanField(default=False)),
                ('course_listing', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='course_sessions', to='core.CourseListing')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Credential',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Education',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('school', models.CharField(max_length=255)),
                ('year_started', models.IntegerField(blank=True, null=True)),
                ('year_ended', models.IntegerField(blank=True, null=True)),
                ('degree_type', models.PositiveSmallIntegerField(blank=True, choices=[(1, b'High School'), (2, b"Associate's Degree"), (3, b"Bachelor's Degree"), (4, b"Master's Degree"), (5, b'Doctor of Philosophy (Ph. D.)'), (6, b'Master of Business Administration (M.B.A.)'), (7, b'Juris Doctor (J.D.)'), (8, b'Doctor of Medicine (M.D.)'), (9, b'Other')])),
                ('field_of_study', models.CharField(blank=True, max_length=255, null=True)),
                ('grade', models.CharField(blank=True, max_length=64, null=True)),
                ('description', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Experience',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.CharField(max_length=255)),
                ('organization', models.CharField(blank=True, max_length=255, null=True)),
                ('year_started', models.IntegerField(blank=True, null=True)),
                ('year_ended', models.IntegerField(blank=True, null=True)),
                ('description', models.TextField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='InstructorProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('last_modified', models.DateTimeField(auto_now=True)),
                ('biography', models.TextField(blank=True, null=True)),
                ('website', models.URLField(blank=True, max_length=255, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('will_travel', models.BooleanField(default=False)),
                ('trial_lesson', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('account_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('first_name', models.CharField(max_length=255)),
                ('last_name', models.CharField(max_length=255)),
                ('avatar', models.ImageField(blank=True, max_length=256, null=True, upload_to=guru_api.core.upload_paths.UploadPath(b'users'))),
                ('gender', models.CharField(choices=[(b'M', b'Male'), (b'F', b'Female')], max_length=1)),
                ('phone_number', models.CharField(blank=True, max_length=15, null=True, validators=[django.core.validators.RegexValidator(message=b"Phone number must be entered in the format: '+999999999'.", regex=b'^\\+?1?\\d{9,15}$')])),
            ],
            options={
                'abstract': False,
            },
            bases=('core.account',),
        ),
        migrations.AddField(
            model_name='experience',
            name='instructor_profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='experience', to='core.InstructorProfile'),
        ),
        migrations.AddField(
            model_name='education',
            name='instructor_profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='education', to='core.InstructorProfile'),
        ),
        migrations.AddField(
            model_name='credential',
            name='instructor_profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='credentials', to='core.InstructorProfile'),
        ),
        migrations.AddField(
            model_name='courselisting',
            name='instructor_profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='course_listings', to='core.InstructorProfile'),
        ),
        migrations.AddField(
            model_name='instructorprofile',
            name='user',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='instructor_profile', to='core.User'),
        ),
        migrations.AddField(
            model_name='coursesession',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='course_sesions', to='core.User'),
        ),
    ]
