From ac5fcca035d84b8668fdb47ee517ccc4d9326e11 Mon Sep 17 00:00:00 2001 From: Eric Solender Date: Fri, 22 Oct 2021 14:32:11 -0400 Subject: [PATCH] fix constraints in v3 --- index_v3.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index_v3.go b/index_v3.go index b3012f0..c60fa9d 100644 --- a/index_v3.go +++ b/index_v3.go @@ -160,7 +160,7 @@ func createAllIndexesAndConstraintsV3(ctx context.Context, gogm *Gogm, mappedTyp Name: node, Type: structConfig.Label, Field: config.Name, - })).ToCypher() + })).Cypher("IF NOT EXISTS").ToCypher() if err != nil { return err } @@ -180,7 +180,7 @@ func createAllIndexesAndConstraintsV3(ctx context.Context, gogm *Gogm, mappedTyp cyp, err := dsl.QB().Create(dsl.NewIndex(&dsl.IndexConfig{ Type: structConfig.Label, Fields: indexFields, - })).ToCypher() + })).Cypher("IF NOT EXISTS").ToCypher() if err != nil { return err }