# Generated by Django 2.2.7 on 2019-11-26 10:55

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),
        ('item', '0031_auto_20191124_1334'),
    ]

    operations = [
        migrations.CreateModel(
            name='Borrow',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('request_date', models.DateField(blank=True, null=True)),
                ('request_time', models.CharField(blank=True, max_length=8, null=True)),
                ('borrow_date', models.DateField(blank=True, null=True)),
                ('return_date', models.DateField(blank=True, null=True)),
                ('takeback_date', models.DateField(blank=True, null=True)),
                ('status', models.CharField(blank=True, choices=[('01', 'อยู่ในตะกร้า'), ('02', 'รออนุมัติ'), ('03', 'ยืนยันการยืม'), ('04', 'คืนแล้ว'), ('05', 'ยกเลิก'), ('06', 'ของเสีย/หาย'), ('07', 'จอง')], max_length=2, null=True)),
                ('fine', models.IntegerField(blank=True, null=True)),
                ('cancel_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='cancelpt_by', to=settings.AUTH_USER_MODEL)),
                ('confirm_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='confirm_by', to=settings.AUTH_USER_MODEL)),
                ('defective_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='defective_by', to=settings.AUTH_USER_MODEL)),
                ('return_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='return_by', to=settings.AUTH_USER_MODEL)),
                ('student_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='request_by', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Borrow_Item',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('borrow_amount', models.IntegerField(blank=True, null=True)),
                ('borrow_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='borrow.Borrow')),
                ('item_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='item.Item')),
            ],
        ),
        migrations.CreateModel(
            name='Tab',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tab_id', models.CharField(max_length=2)),
                ('tab_name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Reserve',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('can_borrow', models.IntegerField(blank=True, null=True)),
                ('borrow_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='borrow.Borrow')),
                ('borrow_item_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='borrow.Borrow_Item')),
                ('item_id', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='item.Item')),
            ],
        ),
    ]
