From 9f603a6b3c428f416587ac9762d67280dad2801c Mon Sep 17 00:00:00 2001 From: Eric Solender Date: Fri, 22 Oct 2021 14:31:33 -0400 Subject: [PATCH] fix constraints --- cmd/gogmcli/gogm.go | 2 +- index_v4.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/gogmcli/gogm.go b/cmd/gogmcli/gogm.go index 3529039..5d3e7db 100644 --- a/cmd/gogmcli/gogm.go +++ b/cmd/gogmcli/gogm.go @@ -34,7 +34,7 @@ func main() { app := &cli.App{ Name: "gogmcli", HelpName: "gogmcli", - Version: "2.0.0", + Version: "2.1.0", Usage: "used for neo4j operations from gogm schema", Description: "cli for generating and executing migrations with gogm", EnableBashCompletion: true, diff --git a/index_v4.go b/index_v4.go index 0e8ac02..dffc3bb 100644 --- a/index_v4.go +++ b/index_v4.go @@ -179,7 +179,7 @@ func createAllIndexesAndConstraintsV4(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 } @@ -199,7 +199,7 @@ func createAllIndexesAndConstraintsV4(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 }