# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-25 01:35
from __future__ import unicode_literals

from django.conf import settings
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='GiangVien',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ma_giang_vien', models.CharField(blank=True, max_length=255, null=True)),
                ('ten_giang_vien', models.CharField(blank=True, max_length=255, null=True)),
                ('gioi_tinh', models.CharField(choices=[('1', 'Nam'), ('0', 'Nu')], default='1', max_length=9)),
                ('so_dien_thoai', models.IntegerField(blank=True, null=True)),
                ('email', models.EmailField(blank=True, max_length=255, null=True)),
                ('ngay_sinh', models.DateField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated', models.DateTimeField(auto_now_add=True, null=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='giang_vien_created_by', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='giang_vien_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Khoa',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ma_khoa', models.CharField(blank=True, max_length=255, null=True)),
                ('ten_khoa', models.CharField(blank=True, max_length=255, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated', models.DateTimeField(auto_now_add=True, null=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='khoa_created_by', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='khoa_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Khoa_KhoaHoc',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ma_khoa', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tb_khoa', to='app.Khoa')),
            ],
        ),
        migrations.CreateModel(
            name='KhoaHoc',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ma_khoa_hoc', models.CharField(blank=True, max_length=255, null=True)),
                ('ten_khoa_hoc', models.CharField(blank=True, max_length=255, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated', models.DateTimeField(auto_now_add=True, null=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='khoa_hoc_created_by', to=settings.AUTH_USER_MODEL)),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='khoa_hoc_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Lop',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ma_lop', models.CharField(blank=True, max_length=255, null=True)),
                ('ten_lop', models.CharField(blank=True, max_length=255, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated', models.DateTimeField(auto_now_add=True, null=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='lop_created_by', to=settings.AUTH_USER_MODEL)),
                ('ma_khoa_hoc', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='lop_kho_hoc', to='app.KhoaHoc')),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='lop_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='MonHoc',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ma_hoc_phan', models.CharField(blank=True, max_length=255, null=True)),
                ('ten_hoc_phan', models.CharField(blank=True, max_length=255, null=True)),
                ('gioi_han', models.IntegerField(default=0)),
                ('da_dang_ky', models.IntegerField(default=0)),
                ('so_tin_chi', models.IntegerField(default=0)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated', models.DateTimeField(auto_now_add=True, null=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='mon_hoc_created_by', to=settings.AUTH_USER_MODEL)),
                ('ma_giang_vien', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='giang_vien_mon_hoc', to='app.GiangVien')),
                ('ma_khoa', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='khoa_mon_hoc', to='app.Khoa')),
                ('ma_khoa_hoc', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='khoa_hoc_mon_hoc', to='app.KhoaHoc')),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='mon_hoc_updated_by', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SinhVien',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ma_sinh_vien', models.CharField(blank=True, max_length=255, null=True)),
                ('ten_sinh_vien', models.CharField(blank=True, max_length=255, null=True)),
                ('gioi_tinh', models.CharField(choices=[('1', 'Nam'), ('0', 'Nu')], default='1', max_length=9)),
                ('so_dien_thoai', models.IntegerField(blank=True, null=True)),
                ('email', models.EmailField(blank=True, max_length=255, null=True)),
                ('ngay_sinh', models.DateField(blank=True, null=True)),
                ('created', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated', models.DateTimeField(auto_now_add=True, null=True)),
                ('created_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sinh_vien_created_by', to=settings.AUTH_USER_MODEL)),
                ('ma_lop', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sinh_vien_lop', to='app.Lop')),
                ('updated_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sinh_vien_updated_by', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sinh_vien_user', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='SinhVien_MonHoc',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ma_hoc_phan', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='mon_hoc', to='app.MonHoc')),
                ('ma_sinh_vien', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='sinh_vien', to='app.SinhVien')),
            ],
        ),
        migrations.AddField(
            model_name='khoa_khoahoc',
            name='ma_khoa_hoc',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tb_khoa_hoc', to='app.KhoaHoc'),
        ),
    ]
