MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Schema_RemoveConstraint

Function Schema_RemoveConstraint

src/schema/schema.c:720–740  ·  view source on GitHub ↗

removes constraint from schema

Source from the content-addressed store, hash-verified

718
719// removes constraint from schema
720void Schema_RemoveConstraint
721(
722 Schema *s, // schema
723 Constraint c // constraint to remove
724) {
725 // validations
726 ASSERT(s != NULL);
727 ASSERT(c != NULL);
728
729 // search for constraint
730 uint n = array_len(s->constraints);
731 for(uint i = 0; i < n; i++) {
732 if(c == s->constraints[i]) {
733 Constraint_IncPendingChanges(c);
734 array_del_fast(s->constraints, i);
735 return;
736 }
737 }
738
739 ASSERT(false);
740}
741
742// enforce all constraints under given schema on entity
743bool Schema_EnforceConstraints

Callers 2

_Constraint_DropFunction · 0.85
_Constraint_CreateFunction · 0.85

Calls 2

array_lenFunction · 0.85

Tested by

no test coverage detected