Sha256: 874fcfc61b51136afc49de590ad1bd99b4c170e89ea505b0515b36e82563b875

Contents?: true

Size: 496 Bytes

Versions: 2

Compression:

Stored size: 496 Bytes

Contents

module Neoon
  module Cypher
    module Schema
      module Constraints

        def create_constraint(key)
          cypher_query = "CREATE CONSTRAINT ON (node:#{label}) ASSERT node.#{key.to_s.downcase} IS UNIQUE"
          cypherable(:query => cypher_query)
        end

        def drop_constraint(key)
          cypher_query = "DROP CONSTRAINT ON (node:#{label}) ASSERT node.#{key.to_s.downcase} IS UNIQUE"
          cypherable(:query => cypher_query)
        end

      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
neoon-0.0.5 lib/neoon/cypher/schema/constraints.rb
neoon-0.0.4 lib/neoon/cypher/schema/constraints.rb