# Generated by Django 3.1.3 on 2020-11-28 21:10

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('firstname', models.CharField(max_length=100, verbose_name='Nombre')),
                ('lastname', models.CharField(max_length=100, verbose_name='Nombre')),
                ('nacionality', models.CharField(choices=[('MX', 'México'), ('CO', 'Colombia'), ('EUA', 'Estados Unidos'), ('ES', 'España')], default='MX', max_length=100)),
            ],
            options={
                'verbose_name': 'Autor',
                'verbose_name_plural': 'Autores',
            },
        ),
        migrations.CreateModel(
            name='Editorial',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='Editorial')),
                ('phone', models.CharField(max_length=15, verbose_name='Teléfono')),
                ('email', models.CharField(max_length=100, verbose_name='Email')),
                ('facebook', models.URLField(max_length=255, verbose_name='Facebook')),
                ('website', models.URLField(max_length=255, verbose_name='Sitio web')),
            ],
            options={
                'verbose_name': 'Editorial',
                'verbose_name_plural': 'Editoriales',
            },
        ),
        migrations.CreateModel(
            name='Books',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255, verbose_name='Título')),
                ('price', models.DecimalField(decimal_places=2, max_digits=9, verbose_name='Precio')),
                ('author_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='books.author', verbose_name='Autor')),
                ('editorial_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='books.editorial', verbose_name='Editorial')),
            ],
            options={
                'verbose_name': 'Libro',
                'verbose_name_plural': 'Libros',
            },
        ),
    ]
