named index

This commit is contained in:
Dylan Knutson
2025-01-27 16:58:14 +00:00
parent dc5063bb23
commit d6d75aa26a

View File

@@ -120,10 +120,12 @@ module Graph
end
end
index_name =
"index_#{graph_name}_on_#{node_type.name&.underscore&.gsub("/", "_")}_#{virtual_column}"
add_index(
"#{graph_name}_#{kind_plural}_#{partition}",
"(data::jsonb->>'#{virtual_column}')",
**options.merge(where: "type = '#{node_type}'"),
**options.merge(where: "type = '#{node_type}'", name: index_name),
)
end