Skip to content
This repository was archived by the owner on Jan 27, 2023. It is now read-only.

Commit 4e44a9b

Browse files
committed
add fn to use for validation of unique constraint to index class
1 parent 061dfaf commit 4e44a9b

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lib/cipherstash/index.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ def subclass_from_kind(kind)
3535
end
3636
end
3737

38+
def invalid_unique_constraint?(unique, kind)
39+
[
40+
"match",
41+
"ore-match",
42+
"filter-match",
43+
"field-dynamic-match",
44+
"field-dynamic-filter-match",
45+
"field-dynamic-ore-match",
46+
"dynamic-match",
47+
"dynamic-filter-match",
48+
"dynamic-ore-match"].include?(kind) && unique
49+
end
50+
3851
def generate(id, settings, schema_versions)
3952
subclass = subclass_from_kind(settings["mapping"]["kind"])
4053
subclass.new(id, settings, schema_versions)

0 commit comments

Comments
 (0)