Skip to content

Commit c7dbb1a

Browse files
fix indexes — Disabled field was missing from application queries
reviewer caught it: CreateDeploymentChain always filters on Disabled so the composite indexes from the previous commit won't actually serve those queries. swapped out the four bad entries for the three shapes that match: ProjectId | Disabled | Name | Id ProjectId | Disabled | Kind | Id ProjectId | Disabled | Name | Kind | Id the standalone ProjectId | Id one is redundant with ProjectId | Disabled | Id so dropped it too. Co-authored-by: areebahmeddd <areebahmeddd@users.noreply.github.com> Signed-off-by: srinivasr <sriniv4sreddy@gmail.com>
1 parent 7c1c317 commit c7dbb1a

2 files changed

Lines changed: 22 additions & 24 deletions

File tree

pkg/app/ops/firestoreindexensurer/indexes.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,7 @@
3535
"arrayConfig": ""
3636
},
3737
{
38-
"fieldPath": "Id",
39-
"order": "ASCENDING",
40-
"arrayConfig": ""
41-
}
42-
]
43-
},
44-
{
45-
"collectionGroup": "Application",
46-
"queryScope": "COLLECTION",
47-
"fields": [
48-
{
49-
"fieldPath": "ProjectId",
38+
"fieldPath": "Disabled",
5039
"order": "ASCENDING",
5140
"arrayConfig": ""
5241
},
@@ -71,6 +60,11 @@
7160
"order": "ASCENDING",
7261
"arrayConfig": ""
7362
},
63+
{
64+
"fieldPath": "Disabled",
65+
"order": "ASCENDING",
66+
"arrayConfig": ""
67+
},
7468
{
7569
"fieldPath": "Kind",
7670
"order": "ASCENDING",
@@ -92,6 +86,11 @@
9286
"order": "ASCENDING",
9387
"arrayConfig": ""
9488
},
89+
{
90+
"fieldPath": "Disabled",
91+
"order": "ASCENDING",
92+
"arrayConfig": ""
93+
},
9594
{
9695
"fieldPath": "Name",
9796
"order": "ASCENDING",

pkg/app/ops/firestoreindexensurer/indexes_test.go

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,7 @@ func TestParseIndexes(t *testing.T) {
5959
ArrayConfig: "",
6060
},
6161
{
62-
FieldPath: "Id",
63-
Order: "ASCENDING",
64-
ArrayConfig: "",
65-
},
66-
},
67-
},
68-
{
69-
CollectionGroup: "Application",
70-
QueryScope: "COLLECTION",
71-
Fields: []field{
72-
{
73-
FieldPath: "ProjectId",
62+
FieldPath: "Disabled",
7463
Order: "ASCENDING",
7564
ArrayConfig: "",
7665
},
@@ -95,6 +84,11 @@ func TestParseIndexes(t *testing.T) {
9584
Order: "ASCENDING",
9685
ArrayConfig: "",
9786
},
87+
{
88+
FieldPath: "Disabled",
89+
Order: "ASCENDING",
90+
ArrayConfig: "",
91+
},
9892
{
9993
FieldPath: "Kind",
10094
Order: "ASCENDING",
@@ -116,6 +110,11 @@ func TestParseIndexes(t *testing.T) {
116110
Order: "ASCENDING",
117111
ArrayConfig: "",
118112
},
113+
{
114+
FieldPath: "Disabled",
115+
Order: "ASCENDING",
116+
ArrayConfig: "",
117+
},
119118
{
120119
FieldPath: "Name",
121120
Order: "ASCENDING",

0 commit comments

Comments
 (0)