# Generated by Django 2.2.3 on 2019-07-05 14:24

from django.conf import settings
import django.core.validators
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='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.CharField(blank=True, choices=[('Mystery', 'Mystery'), ('Biographies', 'Biographies'), ('Sci-fi', 'Sci-fi and Fantasy'), ('Horror', 'Horror'), ('Kids', 'Kids'), ('Comics', 'Comics')], default='generic', max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('userType', models.CharField(blank=True, choices=[('Buyer', 'Buyer'), ('Seller', 'Seller')], default='Buyer', max_length=100)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, default='', max_length=100)),
                ('published', models.DateTimeField()),
                ('price', models.DecimalField(decimal_places=2, max_digits=4)),
                ('stock', models.IntegerField(validators=[django.core.validators.MinValueValidator(1)])),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='booksale.Category')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='books', to='booksale.Profile')),
            ],
            options={
                'ordering': ('title',),
            },
        ),
    ]
