# Generated by Django 5.2.3 on 2025-06-21 14:42

import core.fields.image
import django.contrib.postgres.indexes
import django.db.models.deletion
import parler.fields
import parler.models
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('product', '0023_remove_productimage_thumbnail'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='productcategory',
            name='menu_image_one',
        ),
        migrations.RemoveField(
            model_name='productcategory',
            name='menu_image_two',
        ),
        migrations.RemoveField(
            model_name='productcategory',
            name='menu_main_banner',
        ),
        migrations.AddField(
            model_name='productcategory',
            name='active',
            field=models.BooleanField(default=True, verbose_name='Active'),
        ),
        migrations.CreateModel(
            name='ProductCategoryImage',
            fields=[
                ('sort_order', models.IntegerField(editable=False, null=True, verbose_name='Sort Order')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated At')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('image', core.fields.image.ImageAndSvgField(upload_to='uploads/categories/', verbose_name='Image')),
                ('image_type', models.CharField(choices=[('MAIN', 'Main Image'), ('BANNER', 'Banner Image'), ('ICON', 'Icon Image'), ('THUMBNAIL', 'Thumbnail Image'), ('GALLERY', 'Gallery Image'), ('BACKGROUND', 'Background Image'), ('HERO', 'Hero Image'), ('FEATURE', 'Feature Image'), ('PROMOTIONAL', 'Promotional Image'), ('SEASONAL', 'Seasonal Image')], default='MAIN', max_length=20, verbose_name='Image Type')),
                ('active', models.BooleanField(default=True, verbose_name='Active')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='product.productcategory')),
            ],
            options={
                'verbose_name': 'Product Category Image',
                'verbose_name_plural': 'Product Category Images',
                'ordering': ['sort_order'],
            },
            bases=(parler.models.TranslatableModelMixin, models.Model),
        ),
        migrations.CreateModel(
            name='ProductCategoryImageTranslation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('language_code', models.CharField(db_index=True, max_length=15, verbose_name='Language')),
                ('title', models.CharField(blank=True, max_length=255, null=True, verbose_name='Title')),
                ('alt_text', models.CharField(blank=True, max_length=255, null=True, verbose_name='Alt Text')),
                ('master', parler.fields.TranslationsForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='product.productcategoryimage')),
            ],
            options={
                'verbose_name': 'Product Category Image Translation',
                'db_table': 'product_productcategoryimage_translation',
                'db_tablespace': '',
                'managed': True,
                'default_permissions': (),
            },
            bases=(parler.models.TranslatedFieldsModelMixin, models.Model),
        ),
        migrations.AddIndex(
            model_name='productcategoryimage',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['created_at'], name='cat_img_created_ix'),
        ),
        migrations.AddIndex(
            model_name='productcategoryimage',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['updated_at'], name='cat_img_updated_ix'),
        ),
        migrations.AddIndex(
            model_name='productcategoryimage',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['sort_order'], name='cat_img_sort_ix'),
        ),
        migrations.AddIndex(
            model_name='productcategoryimage',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['category', 'image_type'], name='cat_img_category_type_ix'),
        ),
        migrations.AddIndex(
            model_name='productcategoryimage',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['category', 'active'], name='cat_img_category_active_ix'),
        ),
        migrations.AddIndex(
            model_name='productcategoryimage',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['image_type', 'active'], name='cat_img_type_active_ix'),
        ),
        migrations.AlterUniqueTogether(
            name='productcategoryimage',
            unique_together={('category', 'image_type')},
        ),
        migrations.AlterUniqueTogether(
            name='productcategoryimagetranslation',
            unique_together={('language_code', 'master')},
        ),
    ]
