Index: service/datastore/index.go |
diff --git a/service/datastore/index.go b/service/datastore/index.go |
index 0f1aaca469903e6cef8ba46bda5073dbb22f61f9..0c50541e0ab877dedffc0a7942dfc61e73931e15 100644 |
--- a/service/datastore/index.go |
+++ b/service/datastore/index.go |
@@ -39,6 +39,18 @@ type IndexDefinition struct { |
SortBy []IndexColumn |
} |
+func (id *IndexDefinition) Equal(o *IndexDefinition) bool { |
+ if id.Kind != o.Kind || id.Ancestor != o.Ancestor || len(id.SortBy) != len(o.SortBy) { |
+ return false |
+ } |
+ for i, col := range id.SortBy { |
+ if col != o.SortBy[i] { |
+ return false |
+ } |
+ } |
+ return true |
+} |
+ |
// Yeah who needs templates, right? |
// <flames>This is fine.</flames> |