cli: fix cli-console failing to add migrations if there are tabs in SQL body

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2822
Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com>
GitOrigin-RevId: 1036a177e81a24ac4d047b56aead42d297682c14
This commit is contained in:
Kali Vara Purushotham Santhati 2021-11-10 18:05:16 +05:30 committed by hasura-bot
parent 691b9233ce
commit 7d26e86fa1
2 changed files with 3 additions and 2 deletions

View File

@ -6,6 +6,7 @@
- server: fix to allow remote schema response to contain an "extensions" field (#7143)
- console: add comments to tracked functions
- metadata SDK: add type definitions for config v3
- cli: fix cli-console failing to add migrations if there are tabs in SQL body (#7362)
- cli: core CLI features are not blocked in environments without internet (#7695)

View File

@ -2,6 +2,7 @@ package hasuradb
import (
"crypto/tls"
"encoding/json"
"fmt"
"io"
"io/ioutil"
@ -20,7 +21,6 @@ import (
"github.com/mitchellh/mapstructure"
"github.com/goccy/go-yaml"
"github.com/hasura/graphql-engine/cli/v2/migrate/database"
"github.com/parnurzeal/gorequest"
log "github.com/sirupsen/logrus"
@ -269,7 +269,7 @@ func (h *HasuraDB) Run(migration io.Reader, fileType, fileName string) error {
}
case "meta":
var metadataRequests []interface{}
err := yaml.Unmarshal(migr, &metadataRequests)
err := json.Unmarshal(migr, &metadataRequests)
if err != nil {
h.migrationQuery.ResetArgs()
return err