# Generated by Django 2.1.2 on 2019-03-26 02:37

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='id')),
                ('title', models.CharField(max_length=200, verbose_name='Título')),
                ('slug', models.SlugField(max_length=100)),
                ('price', models.DecimalField(decimal_places=2, max_digits=10, verbose_name='Precio')),
                ('author', models.CharField(max_length=200, verbose_name='Autor')),
                ('publisher', models.CharField(max_length=200, verbose_name='Editorial')),
                ('datePosted', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Fecha de Publicación')),
                ('rating', models.PositiveIntegerField(default=0, verbose_name='Calificación')),
                ('quality', models.CharField(max_length=100, verbose_name='Calidad')),
                ('image', models.ImageField(default='defaultBook.jpg', upload_to='book_pics')),
            ],
            options={
                'ordering': ('title',),
            },
        ),
        migrations.CreateModel(
            name='Genre',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='id')),
                ('slug', models.SlugField(max_length=150, unique=True)),
                ('name', models.CharField(max_length=100, verbose_name='Género')),
            ],
            options={
                'verbose_name': 'Género',
                'verbose_name_plural': 'Géneros',
                'ordering': ('name',),
            },
        ),
        migrations.CreateModel(
            name='Subject',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='id')),
                ('slug', models.SlugField(max_length=150, unique=True)),
                ('name', models.CharField(max_length=100, verbose_name='Materia')),
            ],
            options={
                'verbose_name': 'Materia',
                'verbose_name_plural': 'Materias',
                'ordering': ('name',),
            },
        ),
        migrations.AddField(
            model_name='book',
            name='genre',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='store.Genre', verbose_name='Género'),
        ),
        migrations.AddField(
            model_name='book',
            name='publishedBy',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Publicado por'),
        ),
        migrations.AddField(
            model_name='book',
            name='subject',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='store.Subject', verbose_name='Materia'),
        ),
        migrations.AlterIndexTogether(
            name='book',
            index_together={('id', 'slug')},
        ),
    ]
