# Generated by Django 5.2.14 on 2026-08-19 18:01

import apps.base.utils.images
import django.db.models.deletion
import simple_history.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('product', '0008_historicalproductangleimage_productangleimage'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.RemoveField(
            model_name='productimage',
            name='product',
        ),
        migrations.CreateModel(
            name='HistoricalProductColorImage',
            fields=[
                ('id', models.IntegerField(blank=True, db_index=True)),
                ('is_deleted', models.BooleanField(default=False, verbose_name='Eliminado')),
                ('created_at', models.DateField(blank=True, editable=False, verbose_name='Fecha de Creación')),
                ('updated_at', models.DateField(blank=True, editable=False, verbose_name='Fecha de Modificación')),
                ('deleted_at', models.DateField(blank=True, null=True, verbose_name='Fecha de Eliminación')),
                ('color_image', models.TextField(blank=True, max_length=100, null=True, verbose_name='Imagen')),
                ('color_hex', models.CharField(default='#000000', help_text='Código de color hexadecimal (ej. #FF5733)', max_length=7, verbose_name='Color Hexadecimal')),
                ('color_name', models.CharField(blank=True, help_text='Nombre del color asociado a la imagen (ej. Rojo, Azul, Verde)', max_length=100, null=True, verbose_name='Nombre del Color')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField(db_index=True)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
                ('product', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='product.product', verbose_name='Producto')),
            ],
            options={
                'verbose_name': 'historical Imagen de Producto',
                'verbose_name_plural': 'historical Imágenes de Productos',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': ('history_date', 'history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='ProductColorImage',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField(default=False, verbose_name='Eliminado')),
                ('created_at', models.DateField(auto_now_add=True, verbose_name='Fecha de Creación')),
                ('updated_at', models.DateField(auto_now=True, verbose_name='Fecha de Modificación')),
                ('deleted_at', models.DateField(blank=True, null=True, verbose_name='Fecha de Eliminación')),
                ('color_image', models.ImageField(blank=True, null=True, upload_to=apps.base.utils.images.rename_image_upload_to, verbose_name='Imagen')),
                ('color_hex', models.CharField(default='#000000', help_text='Código de color hexadecimal (ej. #FF5733)', max_length=7, verbose_name='Color Hexadecimal')),
                ('color_name', models.CharField(blank=True, help_text='Nombre del color asociado a la imagen (ej. Rojo, Azul, Verde)', max_length=100, null=True, verbose_name='Nombre del Color')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='product.product', verbose_name='Producto')),
            ],
            options={
                'verbose_name': 'Imagen de Producto',
                'verbose_name_plural': 'Imágenes de Productos',
            },
        ),
        migrations.DeleteModel(
            name='HistoricalProductImage',
        ),
        migrations.DeleteModel(
            name='ProductImage',
        ),
    ]
