Skip to content

Commit 6d2f40c

Browse files
committed
Rename tag from pg-comment to comment.
1 parent 5c75524 commit 6d2f40c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

database/pgComment.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ func MakeComments(ctx context.Context, sc SchemeCommenter, models ...interface{}
2727
tableName = hasura.ToSnakeCase(modelType.Name())
2828
}
2929

30-
pgCommentTag, ok := getPgComment(fieldType)
30+
comment, ok := getComment(fieldType)
3131
if !ok {
3232
continue
3333
}
3434

35-
if err := sc.MakeTableComment(ctx, tableName, pgCommentTag); err != nil {
35+
if err := sc.MakeTableComment(ctx, tableName, comment); err != nil {
3636
return err
3737
}
3838

3939
continue
4040
}
4141

42-
pgCommentTag, ok := getPgComment(fieldType)
42+
comment, ok := getComment(fieldType)
4343
if !ok {
4444
continue
4545
}
@@ -49,7 +49,7 @@ func MakeComments(ctx context.Context, sc SchemeCommenter, models ...interface{}
4949
columnName = hasura.ToSnakeCase(fieldType.Name)
5050
}
5151

52-
if err := sc.MakeColumnComment(ctx, tableName, columnName, pgCommentTag); err != nil {
52+
if err := sc.MakeColumnComment(ctx, tableName, columnName, comment); err != nil {
5353
return err
5454
}
5555
}
@@ -73,11 +73,11 @@ func getPgName(fieldType reflect.StructField) (name string, ok bool) {
7373
return "", false
7474
}
7575

76-
func getPgComment(fieldType reflect.StructField) (string, bool) {
77-
pgCommentTag, ok := fieldType.Tag.Lookup("pg-comment")
76+
func getComment(fieldType reflect.StructField) (string, bool) {
77+
commentTag, ok := fieldType.Tag.Lookup("comment")
7878

7979
if ok {
80-
return pgCommentTag, ok
80+
return commentTag, ok
8181
}
8282

8383
return "", false

0 commit comments

Comments
 (0)