# Generated by Django 3.1.3 on 2021-01-15 21:48

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),
    ]

    operations = [
        migrations.CreateModel(
            name='caracteristica',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=150)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Caracteristicas',
                'verbose_name_plural': 'Caracteristica',
            },
        ),
        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)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now_add=True)),
                ('padre', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='tienda.categoria')),
            ],
            options={
                'verbose_name': 'Cateegorias',
                'verbose_name_plural': 'Categoria',
            },
        ),
        migrations.CreateModel(
            name='imagen',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('imagen', models.ImageField(blank=True, null=True, upload_to='productos')),
                ('estado', models.CharField(choices=[('active', 'Activa'), ('Inactiva', 'Inactiva')], default='Inactiva', max_length=50)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name': 'Imagenes',
                'verbose_name_plural': 'Imagen',
            },
        ),
        migrations.CreateModel(
            name='Producto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre', models.CharField(max_length=50)),
                ('descripcion', models.TextField()),
                ('precio', models.FloatField()),
                ('ventas', models.IntegerField(default=0)),
                ('estado', models.CharField(choices=[('nuevo', 'Nuevo'), ('usado', 'Usado'), ('virtual', 'Virtual')], default='Nuevo', max_length=50)),
                ('stock', models.IntegerField(default=0)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now_add=True)),
                ('caracteristica', models.ManyToManyField(to='tienda.caracteristica')),
                ('categorias', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to='tienda.categoria')),
                ('usuario', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Productos',
                'verbose_name_plural': 'Producto',
            },
        ),
        migrations.CreateModel(
            name='Imagen_producto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now_add=True)),
                ('caracteristica', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tienda.producto', verbose_name='Producto')),
                ('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='tienda.imagen', verbose_name='Imagen')),
            ],
            options={
                'verbose_name': 'Imagenes de productos',
                'verbose_name_plural': 'Imagen de producto',
            },
        ),
    ]
