From efeab3e426c3519e04d69c2225fb87defd0fa405 Mon Sep 17 00:00:00 2001 From: Egor fureunoir Gorbunov Date: Sat, 18 Oct 2025 11:48:40 +0300 Subject: [PATCH] Features: 1) Add multiple database indexes to enhance query performance for models `order`, `orderproduct`, and `product`. Fixes: 1) Remove redundant blank line in migration file. Extra: 1) Simplify index definition formatting for better readability. --- ...ct_name_alter_product_name_ar_ar_and_more.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/core/migrations/0045_alter_product_name_alter_product_name_ar_ar_and_more.py b/core/migrations/0045_alter_product_name_alter_product_name_ar_ar_and_more.py index 44a56555..8c777d35 100644 --- a/core/migrations/0045_alter_product_name_alter_product_name_ar_ar_and_more.py +++ b/core/migrations/0045_alter_product_name_alter_product_name_ar_ar_and_more.py @@ -5,7 +5,6 @@ from django.db import migrations, models class Migration(migrations.Migration): - dependencies = [ ("core", "0044_vendor_last_processing_response"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), @@ -332,27 +331,19 @@ class Migration(migrations.Migration): ), migrations.AddIndex( model_name="order", - index=models.Index( - fields=["user", "status"], name="core_order_user_id_4407f8_idx" - ), + index=models.Index(fields=["user", "status"], name="core_order_user_id_4407f8_idx"), ), migrations.AddIndex( model_name="order", - index=models.Index( - fields=["status", "buy_time"], name="core_order_status_4a088a_idx" - ), + index=models.Index(fields=["status", "buy_time"], name="core_order_status_4a088a_idx"), ), migrations.AddIndex( model_name="orderproduct", - index=models.Index( - fields=["order", "status"], name="core_orderp_order_i_d16192_idx" - ), + index=models.Index(fields=["order", "status"], name="core_orderp_order_i_d16192_idx"), ), migrations.AddIndex( model_name="orderproduct", - index=models.Index( - fields=["product", "status"], name="core_orderp_product_ee8abb_idx" - ), + index=models.Index(fields=["product", "status"], name="core_orderp_product_ee8abb_idx"), ), migrations.AddIndex( model_name="product",