# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-03-25 09:33
from __future__ import unicode_literals

import boardinghouse.base
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),
    ]

    operations = [
        migrations.CreateModel(
            name='Enrolment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enrolment_date', models.DateField()),
                ('year', models.IntegerField()),
                ('semester', models.IntegerField(choices=[(0, 'Summer Semester'), (1, 'Semester 1'), (2, 'Semester 2')])),
                ('grade', models.CharField(blank=True, choices=[('HD', 'High Distinction'), ('D', 'Distinction'), ('C', 'Credit'), ('P1', 'Pass, Level 1'), ('P2', 'Pass, Level 2'), ('F1', 'Fail, Level 1'), ('F2', 'Fail, Level 2'), ('NGP', 'Non-Graded Pass'), ('NGF', 'Non-Graded Fail')], max_length=3, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='School',
            fields=[
                ('schema', models.CharField(help_text='The internal name of the schema.<br>May only contain lowercase letters, digits and underscores. Must start with a letter.<br>May not be changed after creation.', max_length=36, primary_key=True, serialize=False, unique=True, validators=[django.core.validators.RegexValidator(message='May only contain lowercase letters, digits and underscores. Must start with a letter.', regex='^[a-z][a-z0-9_]*$')])),
                ('name', models.CharField(help_text='The display name of the schema.', max_length=128, unique=True)),
                ('is_active', models.BooleanField(default=True, help_text='Use this instead of deleting schemata.')),
                ('users', models.ManyToManyField(blank=True, help_text='Which users may access data from this schema.', related_name='schemata', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            bases=(boardinghouse.base.SharedSchemaMixin, models.Model),
        ),
        migrations.CreateModel(
            name='StaffMember',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('staff_id', models.CharField(max_length=16, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('student_id', models.CharField(max_length=16, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, unique=True)),
            ],
        ),
        migrations.AddField(
            model_name='enrolment',
            name='student',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='enrolments', to='school.Student'),
        ),
        migrations.AddField(
            model_name='enrolment',
            name='subject',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='enrolments', to='school.Subject'),
        ),
    ]
