Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add missing index on search_index_dirty (#10854)

Tomasz Szymańskibac19498f13b
diff --git a/saleor/product/migrations/0172_alter_product_search_index_dirty.py b/saleor/product/migrations/0172_alter_product_search_index_dirty.py
new file mode 100644
index 0000000000..3e9059a611
--- /dev/null
+++ b/saleor/product/migrations/0172_alter_product_search_index_dirty.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.2.16 on 2022-10-07 09:13
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("product", "0171_product_search_index_dirty"),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name="product",
+ name="search_index_dirty",
+ field=models.BooleanField(db_index=True, default=False),
+ ),
+ ]
diff --git a/saleor/product/migrations/0174_merge_20221007_1322.py b/saleor/product/migrations/0174_merge_20221007_1322.py
new file mode 100644
index 0000000000..0725ac9810
--- /dev/null
+++ b/saleor/product/migrations/0174_merge_20221007_1322.py
@@ -0,0 +1,13 @@
+# Generated by Django 3.2.16 on 2022-10-07 13:22
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("product", "0172_alter_product_search_index_dirty"),
+ ("product", "0173_create_default_category_and_product_type"),
+ ]
+
+ operations = []
diff --git a/saleor/product/migrations/0176_merge_20221007_1324.py b/saleor/product/migrations/0176_merge_20221007_1324.py
new file mode 100644
index 0000000000..fd843c56b7
--- /dev/null
+++ b/saleor/product/migrations/0176_merge_20221007_1324.py
@@ -0,0 +1,13 @@
+# Generated by Django 3.2.16 on 2022-10-07 13:24
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("product", "0174_merge_20221007_1322"),
+ ("product", "0175_alter_productmedia_product"),
+ ]
+
+ operations = []
diff --git a/saleor/product/models.py b/saleor/product/models.py
index 32e493596c..5da0e7ef36 100644
--- a/saleor/product/models.py
+++ b/saleor/product/models.py
@@ -396,7 +396,7 @@ class Product(SeoModel, ModelWithMetadata):
description_plaintext = TextField(blank=True)
search_document = models.TextField(blank=True, default="")
search_vector = SearchVectorField(blank=True, null=True)
- search_index_dirty = models.BooleanField(default=False)
+ search_index_dirty = models.BooleanField(default=False, db_index=True)
category = models.ForeignKey(
Category,