# Generated by Django 3.2.5 on 2021-07-20 02:17

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='Carro',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('creacion', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='CarroProducto',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('cantidad', models.IntegerField(default=1)),
                ('precio_descuento', models.FloatField(blank=True)),
                ('carro', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.carro')),
            ],
        ),
        migrations.CreateModel(
            name='EstadoDespacho',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=500)),
            ],
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=500)),
                ('imagen', models.CharField(max_length=500)),
                ('precio', models.IntegerField()),
                ('precio_oferta', models.IntegerField(default=0)),
                ('stock', models.IntegerField()),
                ('ingreso', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('actualizacion', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='TipoMascota',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=500)),
            ],
        ),
        migrations.CreateModel(
            name='TipoProducto',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=500)),
            ],
        ),
        migrations.CreateModel(
            name='Venta',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('fecha', models.DateField(default=django.utils.timezone.now, editable=False)),
                ('monto', models.IntegerField()),
                ('descuento', models.FloatField()),
                ('productos', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.carro')),
                ('usuario', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Promocion',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('nombre', models.CharField(max_length=500)),
                ('combo', models.IntegerField(blank=True, null=True)),
                ('imagen', models.CharField(blank=True, max_length=500, null=True)),
                ('minimo', models.IntegerField(blank=True, null=True)),
                ('maximo', models.IntegerField(blank=True, null=True)),
                ('cantidad', models.IntegerField(default=1)),
                ('producto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.producto')),
            ],
        ),
        migrations.AddField(
            model_name='producto',
            name='tipo_mascota',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.tipomascota'),
        ),
        migrations.AddField(
            model_name='producto',
            name='tipo_producto',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.tipoproducto'),
        ),
        migrations.CreateModel(
            name='Perfil',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('telefono', models.CharField(max_length=11)),
                ('direccion', models.CharField(max_length=255)),
                ('ciudad', models.CharField(max_length=255)),
                ('comuna', models.CharField(max_length=255)),
                ('codigo_postal', models.CharField(max_length=6)),
                ('comentario', models.CharField(max_length=500)),
                ('usuario', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Despacho',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('fecha', models.DateField(default=django.utils.timezone.now, editable=False)),
                ('origen', models.CharField(max_length=500)),
                ('ubicacion', models.CharField(blank=True, max_length=500)),
                ('carro', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.carroproducto')),
                ('estado', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.estadodespacho')),
            ],
        ),
        migrations.AddField(
            model_name='carroproducto',
            name='producto',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.producto'),
        ),
    ]
