# Generated by Django 3.0.7 on 2020-07-28 22:42

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='DAYNHA',
            fields=[
                ('DayNha', models.CharField(max_length=100, primary_key=True, serialize=False)),
            ],
            options={
                'db_table': 'DAYNHA',
            },
        ),
        migrations.CreateModel(
            name='NHANSU',
            fields=[
                ('MaNV', models.IntegerField(primary_key=True, serialize=False)),
                ('HoTen', models.CharField(max_length=25)),
                ('CMND', models.IntegerField()),
                ('NgaySinh', models.DateField()),
                ('GioiTinh', models.CharField(choices=[('Nam', 'Nam'), ('Nữ', 'Nữ')], max_length=6)),
                ('QueQuan', models.CharField(max_length=50)),
                ('ChucVu', models.CharField(max_length=15)),
                ('SDT', models.CharField(max_length=100)),
            ],
            options={
                'db_table': 'NHANSU',
            },
        ),
        migrations.CreateModel(
            name='PHONG',
            fields=[
                ('MaPhong', models.IntegerField(primary_key=True, serialize=False)),
                ('TenPhong', models.CharField(max_length=10)),
                ('SoLuongSV', models.IntegerField()),
                ('LoaiPhong', models.IntegerField()),
                ('GiaPhong', models.IntegerField()),
                ('GioiTinhSV', models.CharField(choices=[('Nam', 'Nam'), ('Nữ', 'Nữ')], max_length=6)),
                ('DayNha', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='accounts.DAYNHA')),
            ],
            options={
                'db_table': 'PHONG',
            },
        ),
        migrations.CreateModel(
            name='SINHVIEN',
            fields=[
                ('MaSV', models.IntegerField(primary_key=True, serialize=False)),
                ('HoTen', models.CharField(max_length=50)),
                ('CMND', models.IntegerField()),
                ('NgaySinh', models.DateField()),
                ('GioiTinh', models.CharField(choices=[('Nam', 'Nam'), ('Nữ', 'Nữ')], max_length=6)),
                ('QueQuan', models.CharField(max_length=50)),
            ],
            options={
                'db_table': 'SINHVIEN',
            },
        ),
        migrations.CreateModel(
            name='XEPPHONG',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('NgayVao', models.DateField()),
                ('NgayRa', models.DateField(null=True)),
                ('MaPhong', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.PHONG')),
                ('MaSV', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.SINHVIEN')),
            ],
            options={
                'db_table': 'XEPPHONG',
            },
        ),
        migrations.CreateModel(
            name='VIPHAM',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('NgayVP', models.DateField()),
                ('TenLoi', models.CharField(max_length=50)),
                ('MaSV', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.SINHVIEN')),
            ],
            options={
                'db_table': 'VIPHAM',
            },
        ),
        migrations.CreateModel(
            name='TIENDIEN',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('NgayLap', models.DateField()),
                ('SoTien', models.IntegerField()),
                ('TrangThai', models.CharField(choices=[('Paied', 'Đã nộp'), ('Not paid', 'Chưa nộp')], max_length=10)),
                ('MaPhong', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.PHONG')),
            ],
            options={
                'db_table': 'TIENDIEN',
            },
        ),
        migrations.CreateModel(
            name='QUANLY',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('MaQL', models.CharField(default='0', max_length=100)),
                ('DayNha', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='accounts.DAYNHA')),
                ('MaNV', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='accounts.NHANSU')),
            ],
            options={
                'db_table': 'QUANLY',
            },
        ),
        migrations.CreateModel(
            name='KYLUAT',
            fields=[
                ('ID', models.IntegerField(primary_key=True, serialize=False)),
                ('TenLoi', models.CharField(max_length=50)),
                ('MaNV', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.NHANSU')),
            ],
            options={
                'db_table': 'KYLUAT',
            },
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, null=True)),
                ('phone', models.CharField(max_length=100, null=True)),
                ('profile_pic', models.ImageField(blank=True, null=True, upload_to='')),
                ('date_created', models.DateTimeField(auto_now_add=True, null=True)),
                ('position', models.CharField(choices=[('Sinh viên', 'Sinh viên'), ('Quản lý', 'Quản lý'), ('Giám đốc', 'Giám đốc')], max_length=100, null=True)),
                ('user', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='CTTAISAN',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('TenTS', models.CharField(max_length=50)),
                ('ThayDoi', models.CharField(choices=[('New', 'Thay mới'), ('Fix', 'Sửa chữa')], max_length=3)),
                ('SoLuong', models.IntegerField()),
                ('MaPhong', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.PHONG')),
            ],
            options={
                'db_table': 'CTTAISAN',
            },
        ),
        migrations.CreateModel(
            name='TIENPHONG',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('NgayLap', models.DateField()),
                ('SoTien', models.IntegerField()),
                ('TrangThai', models.CharField(choices=[('Paied', 'Paied'), ('Not paid', 'Not paid')], max_length=10)),
                ('MaSV', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.SINHVIEN')),
            ],
            options={
                'db_table': 'TIENPHONG',
                'unique_together': {('NgayLap', 'MaSV')},
            },
        ),
        migrations.CreateModel(
            name='TAISAN',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('TenTS', models.CharField(max_length=50)),
                ('SoLuong', models.IntegerField()),
                ('MaPhong', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='accounts.PHONG')),
            ],
            options={
                'db_table': 'TAISAN',
                'unique_together': {('MaPhong', 'TenTS')},
            },
        ),
    ]
