# Generated by Django 5.2.1 on 2025-05-14 20:33

import django.contrib.postgres.indexes
from django.conf import settings
from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('country', '0006_remove_country_country_cou_alpha_2_398383_idx_and_more'),
        ('order', '0013_alter_order_floor_alter_order_location_type'),
        ('pay_way', '0007_rename_payway_created_at_idx_payway_created_at_ix_and_more'),
        ('product', '0022_alter_productfavourite_options_and_more'),
        ('region', '0006_rename_region_created_at_idx_region_created_at_ix_and_more'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.RemoveIndex(
            model_name='order',
            name='order_search_gin',
        ),
        migrations.RemoveIndex(
            model_name='orderhistory',
            name='order_order_order_i_4345b0_idx',
        ),
        migrations.RemoveIndex(
            model_name='orderhistory',
            name='order_order_order_i_5a04bb_idx',
        ),
        migrations.RemoveIndex(
            model_name='orderitem',
            name='order_order_product_ed1645_idx',
        ),
        migrations.RemoveIndex(
            model_name='orderitem',
            name='order_order_is_refu_38a302_idx',
        ),
        migrations.RemoveIndex(
            model_name='orderitemhistory',
            name='order_order_order_i_b122c2_idx',
        ),
        migrations.RenameIndex(
            model_name='order',
            new_name='order_created_at_ix',
            old_name='order_created_at_idx',
        ),
        migrations.RenameIndex(
            model_name='order',
            new_name='order_updated_at_ix',
            old_name='order_updated_at_idx',
        ),
        migrations.RenameIndex(
            model_name='order',
            new_name='order_status_ix',
            old_name='order_order_status_3ebebc_btree',
        ),
        migrations.RenameIndex(
            model_name='order',
            new_name='order_doc_type_ix',
            old_name='order_order_documen_0efd90_btree',
        ),
        migrations.RenameIndex(
            model_name='order',
            new_name='order_status_upd_ix',
            old_name='order_order_status__c9f5b7_btree',
        ),
        migrations.RenameIndex(
            model_name='order',
            new_name='order_payment_status_ix',
            old_name='order_order_payment_c12f17_btree',
        ),
        migrations.RenameIndex(
            model_name='orderhistory',
            new_name='orderhistory_created_at_ix',
            old_name='orderhistory_created_at_idx',
        ),
        migrations.RenameIndex(
            model_name='orderhistory',
            new_name='orderhistory_updated_at_ix',
            old_name='orderhistory_updated_at_idx',
        ),
        migrations.RenameIndex(
            model_name='orderitem',
            new_name='orderitem_created_at_ix',
            old_name='orderitem_created_at_idx',
        ),
        migrations.RenameIndex(
            model_name='orderitem',
            new_name='orderitem_updated_at_ix',
            old_name='orderitem_updated_at_idx',
        ),
        migrations.RenameIndex(
            model_name='orderitem',
            new_name='orderitem_sort_order_ix',
            old_name='orderitem_sort_order_idx',
        ),
        migrations.RenameIndex(
            model_name='orderitemhistory',
            new_name='orderitemhistory_created_at_ix',
            old_name='orderitemhistory_created_at_idx',
        ),
        migrations.RenameIndex(
            model_name='orderitemhistory',
            new_name='orderitemhistory_updated_at_ix',
            old_name='orderitemhistory_updated_at_idx',
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['user'], name='order_user_ix'),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['pay_way'], name='order_pay_way_ix'),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['country'], name='order_country_ix'),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['region'], name='order_region_ix'),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['user', 'status'], name='order_user_status_ix'),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['status', 'payment_status'], name='order_status_payment_ix'),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['tracking_number'], name='order_tracking_num_ix'),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['payment_id'], name='order_payment_id_ix'),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.GinIndex(fields=['first_name', 'last_name'], name='order_name_search_ix', opclasses=['gin_trgm_ops', 'gin_trgm_ops']),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.GinIndex(fields=['email'], name='order_email_search_ix', opclasses=['gin_trgm_ops']),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.GinIndex(fields=['street'], name='order_address_street_ix', opclasses=['gin_trgm_ops']),
        ),
        migrations.AddIndex(
            model_name='order',
            index=django.contrib.postgres.indexes.GinIndex(fields=['city', 'place'], name='order_address_location_ix', opclasses=['gin_trgm_ops', 'gin_trgm_ops']),
        ),
        migrations.AddIndex(
            model_name='orderhistory',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['order', 'change_type'], name='ord_hist_ord_chtype_ix'),
        ),
        migrations.AddIndex(
            model_name='orderhistory',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['order', '-created_at'], name='ord_hist_ord_crtd_ix'),
        ),
        migrations.AddIndex(
            model_name='orderhistory',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['change_type'], name='ord_hist_chtype_ix'),
        ),
        migrations.AddIndex(
            model_name='orderitem',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['product'], name='order_item_product_ix'),
        ),
        migrations.AddIndex(
            model_name='orderitem',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['is_refunded'], name='order_item_is_refunded_ix'),
        ),
        migrations.AddIndex(
            model_name='orderitemhistory',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['order_item', '-created_at'], name='ord_item_hist_item_created_ix'),
        ),
        migrations.AddIndex(
            model_name='orderitemhistory',
            index=django.contrib.postgres.indexes.BTreeIndex(fields=['change_type'], name='ord_item_hist_change_type_ix'),
        ),
    ]
