# Generated by Django 2.0.5 on 2018-05-09 12:55

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Admin',
            fields=[
                ('num', models.CharField(max_length=15, primary_key=True, serialize=False)),
                ('name', models.CharField(default='', max_length=15)),
                ('psd', models.CharField(max_length=32)),
                ('token', models.CharField(default='', max_length=42)),
            ],
            options={
                'db_table': 'admin',
            },
        ),
        migrations.CreateModel(
            name='Clazz',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='', max_length=30)),
                ('profession', models.CharField(default='', max_length=30)),
            ],
            options={
                'db_table': 'class',
            },
        ),
        migrations.CreateModel(
            name='Leave',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reason', models.CharField(default='', max_length=100)),
                ('date', models.DateField()),
                ('created_time', models.DateTimeField(auto_now_add=True)),
                ('state', models.IntegerField(default=0)),
            ],
            options={
                'db_table': 'leave',
                'ordering': ['-created_time', '-date'],
            },
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('num', models.CharField(max_length=15, primary_key=True, serialize=False)),
                ('name', models.CharField(default='', max_length=15)),
                ('psd', models.CharField(max_length=32)),
                ('token', models.CharField(default='', max_length=42)),
                ('sex', models.CharField(default='男', max_length=2)),
                ('nation', models.CharField(default='', max_length=100)),
                ('politics_status', models.CharField(default='', max_length=100)),
                ('huji', models.CharField(default='', max_length=100)),
                ('origin', models.CharField(default='', max_length=100)),
                ('address', models.CharField(default='', max_length=100)),
                ('id', models.CharField(default='', max_length=18)),
                ('tele', models.CharField(default='', max_length=11)),
                ('email', models.CharField(default='', max_length=100)),
                ('birth', models.DateField(auto_now_add=True)),
                ('date_in_school', models.DateField(auto_now_add=True)),
                ('chidao', models.IntegerField(default=0)),
                ('zaotui', models.IntegerField(default=0)),
                ('chufen', models.IntegerField(default=0)),
                ('clazz', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='students', to='api.Clazz')),
            ],
            options={
                'db_table': 'student',
            },
        ),
        migrations.CreateModel(
            name='Teacher',
            fields=[
                ('num', models.CharField(max_length=15, primary_key=True, serialize=False)),
                ('name', models.CharField(default='', max_length=15)),
                ('psd', models.CharField(max_length=32)),
                ('token', models.CharField(default='', max_length=42)),
                ('sex', models.CharField(default='男', max_length=2)),
                ('nation', models.CharField(default='', max_length=20)),
                ('politics_status', models.CharField(default='', max_length=15)),
                ('huji', models.CharField(default='', max_length=15)),
                ('origin', models.CharField(default='', max_length=40)),
                ('address', models.CharField(default='', max_length=50)),
                ('id', models.CharField(default='', max_length=18)),
                ('tele', models.CharField(default='', max_length=11)),
                ('email', models.CharField(default='', max_length=30)),
            ],
            options={
                'db_table': 'teacher',
            },
        ),
        migrations.AddField(
            model_name='leave',
            name='student',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leaves', to='api.Student'),
        ),
        migrations.AddField(
            model_name='clazz',
            name='teacher',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='classes', to='api.Teacher'),
        ),
    ]
