# Generated by Django 2.1 on 2019-01-02 12:08

from django.conf import settings
import django.core.validators
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),
        ('auth', '0009_alter_user_last_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Grades',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('grade_name', models.CharField(choices=[('Class 1', '1'), ('Class 2', '2'), ('Class 3', '3'), ('Class 4', '4'), ('Class 5', '5'), ('Class 6', '6'), ('Class 7', '7'), ('Class 8', '8'), ('Class 9', '9'), ('Class 10', '10'), ('Class 11', '11'), ('Class 12', '12')], max_length=10, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='School',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('school_name', models.CharField(max_length=200)),
                ('school_address', models.CharField(max_length=500)),
                ('school_pincode', models.CharField(blank=True, max_length=6, null=True)),
                ('school_contact_no', models.CharField(blank=True, max_length=10, null=True, validators=[django.core.validators.RegexValidator(message='Please enter valid phone number.', regex='[789]\\d{9}$')])),
            ],
        ),
        migrations.CreateModel(
            name='SchoolGradeDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('grades_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='SchoolStudents.Grades')),
                ('school_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SchoolStudents.School')),
            ],
        ),
        migrations.CreateModel(
            name='Sections',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('grade_name', models.CharField(choices=[('A', 'A'), ('B', 'B'), ('C', 'C'), ('D', 'D'), ('E', 'E'), ('F', 'F'), ('G', 'G'), ('H', 'H'), ('Class I', 'I'), ('J', 'J'), ('K', 'K'), ('L', 'L'), ('M', 'M'), ('N', 'N'), ('O', 'O'), ('P', 'P'), ('Q', 'Q'), ('R', 'R'), ('S', 'S'), ('T', 'T'), ('U', 'U'), ('V', 'V'), ('W', 'W'), ('X', 'X'), ('Y', 'Y'), ('Z', 'Z')], max_length=10, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='StudentDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sd_academic_year', models.IntegerField(choices=[(1980, 1980), (1981, 1981), (1982, 1982), (1983, 1983), (1984, 1984), (1985, 1985), (1986, 1986), (1987, 1987), (1988, 1988), (1989, 1989), (1990, 1990), (1991, 1991), (1992, 1992), (1993, 1993), (1994, 1994), (1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019)], default=2019)),
                ('school_profile_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SchoolStudents.School')),
                ('sd_grades', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='SchoolStudents.Grades')),
                ('sd_sections', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='SchoolStudents.Sections')),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_contact_no', models.CharField(blank=True, max_length=10, null=True, validators=[django.core.validators.RegexValidator(message='Phone number is not valid.', regex='[789]\\d{9}$')])),
                ('user_pincode', models.CharField(blank=True, max_length=6, null=True)),
                ('user_profile_image_url', models.URLField(blank=True, null=True)),
                ('user_gender', models.CharField(blank=True, choices=[('Male', 'Male'), ('Female', 'Female'), ('Others', 'Others')], max_length=6, null=True)),
                ('auth_user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('user_group', models.OneToOneField(default='Student', null=True, on_delete=django.db.models.deletion.SET_NULL, to='auth.Group')),
            ],
        ),
        migrations.AddField(
            model_name='studentdetails',
            name='student_profile',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='SchoolStudents.UserProfile'),
        ),
        migrations.AddField(
            model_name='schoolgradedetails',
            name='sections_id',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='SchoolStudents.Sections'),
        ),
    ]
