# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2017-12-23 13:12
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Adress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('city', models.CharField(default='Київ', max_length=32)),
                ('street', models.CharField(default='Незалежності', max_length=32)),
                ('build', models.CharField(default='1', max_length=32)),
                ('flat', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Departament',
            fields=[
                ('name', models.CharField(max_length=128, primary_key=True, serialize=False)),
                ('adress', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Adress')),
            ],
        ),
        migrations.CreateModel(
            name='Facultet',
            fields=[
                ('name', models.CharField(max_length=128, primary_key=True, serialize=False)),
                ('adress', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Adress')),
            ],
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('name', models.CharField(max_length=5, primary_key=True, serialize=False)),
                ('form_of_education', models.CharField(choices=[('full_time', 'денна'), ('external', 'заочна')], max_length=16)),
                ('departament', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Departament')),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('passport', models.CharField(max_length=8, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=32)),
                ('surname', models.CharField(max_length=32)),
                ('birthday_date', models.DateField()),
                ('sex', models.CharField(choices=[('male', 'male'), ('female', 'female')], max_length=5)),
                ('adress', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Adress')),
            ],
        ),
        migrations.CreateModel(
            name='Speciality',
            fields=[
                ('code', models.CharField(max_length=16, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=128)),
            ],
        ),
        migrations.CreateModel(
            name='Student',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('adress', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Adress')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Group')),
                ('student_person', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Person')),
            ],
        ),
        migrations.AddField(
            model_name='group',
            name='speciality',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Speciality'),
        ),
        migrations.AddField(
            model_name='facultet',
            name='main_person',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Person'),
        ),
        migrations.AddField(
            model_name='departament',
            name='facultet',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Facultet'),
        ),
        migrations.AddField(
            model_name='departament',
            name='main_person',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='students_system.Person'),
        ),
    ]
