# Generated by Django 2.0.6 on 2018-06-13 15:44

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Autor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
                ('apellido', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Categoria',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Editora',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Libro',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('titulo', models.CharField(max_length=50)),
                ('aniolanzamiento', models.CharField(max_length=4)),
                ('paginas', models.PositiveIntegerField()),
                ('sinopsis', models.TextField(blank=True)),
                ('imagen', models.URLField(null=True)),
                ('unidades', models.PositiveIntegerField(default='0')),
                ('veces_vendido', models.PositiveIntegerField(default='0')),
                ('momento_creacion', models.DateTimeField(auto_now_add=True)),
                ('momento_modificacion', models.DateTimeField(auto_now=True)),
                ('autor_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.Autor')),
                ('editora_id', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='editora_id', to='books.Editora')),
                ('has_categorias', models.ManyToManyField(to='books.Categoria')),
            ],
        ),
    ]
