# Generated by Django 3.1.7 on 2021-05-23 17:09

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Cliente',
            fields=[
                ('cif', models.CharField(max_length=12, primary_key=True, serialize=False)),
                ('nombre_empresa', models.CharField(max_length=40)),
                ('email', models.EmailField(max_length=254)),
                ('telefono', models.IntegerField(unique=True)),
                ('nombre_cliente', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('producto_referencia', models.CharField(max_length=13, primary_key=True, serialize=False)),
                ('producto_nombre', models.CharField(max_length=50)),
                ('producto_descripcion', models.CharField(max_length=250)),
                ('producto_categoria', models.CharField(max_length=50)),
                ('producto_precio', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('producto_pdf', models.FileField(blank=True, null=True, upload_to='')),
            ],
        ),
        migrations.CreateModel(
            name='Orden_Pedido',
            fields=[
                ('pedido_referencia', models.CharField(max_length=12, primary_key=True, serialize=False)),
                ('pedido_fecha', models.DateField(auto_now=True)),
                ('pedido_descripcion', models.TextField(max_length=250)),
                ('pedido_cliente_cif', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='appEntrega.cliente')),
            ],
        ),
        migrations.CreateModel(
            name='Factura',
            fields=[
                ('referencia', models.CharField(max_length=12, primary_key=True, serialize=False)),
                ('unidades', models.PositiveIntegerField(default=1)),
                ('linea_precio', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('descripcion', models.TextField(max_length=250)),
                ('pedido_referencia', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='appEntrega.orden_pedido')),
                ('producto_referencia', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='appEntrega.producto')),
            ],
        ),
        migrations.CreateModel(
            name='Componente',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('componente_unidades', models.PositiveIntegerField(default=1)),
                ('componente_descripcion', models.CharField(max_length=250)),
                ('componente_producto', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='producto', to='appEntrega.producto')),
                ('componente_producto_padre', models.ForeignKey(default=0, on_delete=django.db.models.deletion.CASCADE, related_name='producto_padre', to='appEntrega.producto')),
            ],
        ),
    ]
