Skip to content

Commit

Permalink
(release/v20.07) Fix(Dgraph): Type names in exported schema are surro…
Browse files Browse the repository at this point in the history
…unded by brackets. (#6679)

If they are not surrounded by brackets, type names with special
characters will not be able to be imported to a new DB.

Fixes DGRAPH-2462.

(cherry picked from commit 51821f3)
  • Loading branch information
martinmr authored Nov 11, 2020
1 parent 67bde0f commit c0c8b1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion worker/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func toSchema(attr string, update *pb.SchemaUpdate) (*bpb.KVList, error) {

func toType(attr string, update pb.TypeUpdate) (*bpb.KVList, error) {
var buf bytes.Buffer
x.Check2(buf.WriteString(fmt.Sprintf("type %s {\n", attr)))
x.Check2(buf.WriteString(fmt.Sprintf("type <%s> {\n", attr)))
for _, field := range update.Fields {
x.Check2(buf.WriteString(fieldToString(field)))
}
Expand Down

0 comments on commit c0c8b1d

Please sign in to comment.