module Neoon::Cypher::Schema::Constraints

Public Instance Methods

create_constraint(key) click to toggle source
# File lib/neoon/cypher/schema/constraints.rb, line 6
def create_constraint(key)
  cypher_query = "CREATE CONSTRAINT ON (node:#{label}) ASSERT node.#{key.to_s.downcase} IS UNIQUE"
  cypherable(:query => cypher_query)
end
drop_constraint(key) click to toggle source
# File lib/neoon/cypher/schema/constraints.rb, line 11
def drop_constraint(key)
  cypher_query = "DROP CONSTRAINT ON (node:#{label}) ASSERT node.#{key.to_s.downcase} IS UNIQUE"
  cypherable(:query => cypher_query)
end