From 9b48f0cef2835a75160a12dd13ec33b4e8ba765d Mon Sep 17 00:00:00 2001 From: Kofo Okesola Date: Tue, 22 Aug 2023 08:49:41 +0100 Subject: [PATCH] fix ci --- analytics/graph_record.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/analytics/graph_record.go b/analytics/graph_record.go index 494fda6f1..e99fdbf8e 100644 --- a/analytics/graph_record.go +++ b/analytics/graph_record.go @@ -7,11 +7,10 @@ import ( "encoding/json" "errors" "fmt" + "github.com/buger/jsonparser" "io/ioutil" "net/http" - "github.com/buger/jsonparser" - "github.com/TykTechnologies/graphql-go-tools/pkg/ast" "github.com/TykTechnologies/graphql-go-tools/pkg/astnormalization" "github.com/TykTechnologies/graphql-go-tools/pkg/astparser" @@ -39,7 +38,12 @@ type GraphRecord struct { HasErrors bool `gorm:"has_errors"` } +// TableName is used by both the sql orm and mongo driver the table name and collection name used for operations on this model +// the conditional return is to ensure the right value is used for both the sql and mongo operations func (g *GraphRecord) TableName() string { + if GraphSQLTableName == "" { + return g.AnalyticsRecord.TableName() + } return GraphSQLTableName }