# Generated by Django 2.2.7 on 2020-02-06 05:20

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='BookDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('author', models.CharField(max_length=100)),
                ('publisher', models.CharField(max_length=500)),
                ('pages', models.IntegerField()),
                ('published_year', models.IntegerField()),
                ('isbn', models.CharField(max_length=13)),
                ('description', models.TextField()),
                ('category', models.CharField(choices=[('E', 'Educational'), ('F', 'Fiction'), ('N', 'Non-Fiction')], max_length=1)),
                ('image', models.ImageField(upload_to='book_images')),
                ('added_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'book_details',
            },
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_accepted', models.BooleanField(default=False)),
                ('is_declined', models.BooleanField(default=False)),
                ('requested_book', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requested_book', to='books.BookDetails')),
                ('requested_trade', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requested_trade', to='books.BookDetails')),
            ],
            options={
                'db_table': 'request_table',
            },
        ),
    ]
