# Generated by Django 3.2.1 on 2021-05-25 17:38

from django.conf import settings
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),
        ('tienda', '0002_producto_imagen'),
    ]

    operations = [
        migrations.CreateModel(
            name='Orden',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('direccion1', models.CharField(max_length=250)),
                ('direccion2', models.CharField(max_length=250)),
                ('ciudad', models.CharField(max_length=100)),
                ('telefono', models.CharField(max_length=100)),
                ('codigo_postal', models.CharField(max_length=20)),
                ('total_pagado', models.DecimalField(decimal_places=3, max_digits=10)),
                ('estado_facturacion', models.BooleanField(default=False)),
                ('orden_pedido', models.CharField(max_length=200)),
                ('creado', models.DateField(auto_now_add=True)),
                ('actualizado', models.DateField(auto_now=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_user', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['creado'],
            },
        ),
        migrations.CreateModel(
            name='OrdenArticulo',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('precio', models.DecimalField(decimal_places=3, max_digits=10)),
                ('cantidad', models.PositiveIntegerField(default=1)),
                ('orden', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='articulo', to='orden.orden')),
                ('producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orden_articulo', to='tienda.producto')),
            ],
        ),
    ]
