# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-02-09 04:44
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('account', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Arrangement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('signature', models.SmallIntegerField(default=1000)),
                ('day_of_week', models.IntegerField(default=0)),
                ('start_week', models.IntegerField(default=0)),
                ('end_week', models.IntegerField(default=0)),
                ('odd_even', models.IntegerField(default=0)),
                ('start_section', models.IntegerField(default=0)),
                ('end_section', models.IntegerField(default=0)),
                ('start_time', models.IntegerField(blank=True, default=0, null=True)),
                ('end_time', models.IntegerField(blank=True, default=0, null=True)),
                ('students', models.ManyToManyField(blank=True, related_name='arrangement_students', to='account.User')),
                ('teacher', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='arrangement_teacher', to='account.User')),
            ],
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('year', models.SmallIntegerField(default=2015)),
                ('term', models.SmallIntegerField(default=1)),
                ('name', models.CharField(blank=True, max_length=255, null=True)),
                ('code', models.CharField(db_index=True, max_length=50)),
                ('arrangements', models.ManyToManyField(blank=True, to='education.Arrangement')),
                ('assistants', models.ManyToManyField(blank=True, related_name='course_assistants', to='account.User')),
            ],
        ),
        migrations.CreateModel(
            name='CourseChoosing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.SmallIntegerField(default=0)),
                ('start_time', models.IntegerField(blank=True, default=0, null=True)),
                ('end_time', models.IntegerField(blank=True, default=0, null=True)),
                ('course', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='education.Course')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='account.User')),
            ],
        ),
        migrations.CreateModel(
            name='CourseMessage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=255, null=True)),
                ('content', models.TextField(blank=True, null=True)),
                ('time', models.IntegerField(default=0)),
                ('author', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='account.User')),
                ('course', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='education.Course')),
            ],
        ),
        migrations.CreateModel(
            name='CourseMessageNotice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('msg', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='education.CourseMessage')),
                ('target', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='account.User')),
            ],
        ),
        migrations.CreateModel(
            name='EduDepartment',
            fields=[
                ('id', models.CharField(max_length=50, primary_key=True, serialize=False)),
                ('name', models.CharField(blank=True, max_length=50, null=True)),
            ],
        ),
        migrations.AddField(
            model_name='course',
            name='department',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='education.EduDepartment'),
        ),
        migrations.AddField(
            model_name='course',
            name='students',
            field=models.ManyToManyField(blank=True, related_name='course_students', to='account.User'),
        ),
        migrations.AddField(
            model_name='course',
            name='teacher',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='course_teacher', to='account.User'),
        ),
    ]
