From 53c8e4263b71d20e8decfcc7a6970e3497473bec Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 9 Jun 2018 16:06:47 +0800 Subject: models: skip JSON for fields skipped by XORM Reduce output JSON size by backup command --- models/comment.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'models/comment.go') diff --git a/models/comment.go b/models/comment.go index 417e4037..447c15db 100644 --- a/models/comment.go +++ b/models/comment.go @@ -52,26 +52,26 @@ type Comment struct { ID int64 Type CommentType PosterID int64 - Poster *User `xorm:"-"` + Poster *User `xorm:"-" json:"-"` IssueID int64 `xorm:"INDEX"` - Issue *Issue `xorm:"-"` + Issue *Issue `xorm:"-" json:"-"` CommitID int64 Line int64 Content string `xorm:"TEXT"` - RenderedContent string `xorm:"-"` + RenderedContent string `xorm:"-" json:"-"` - Created time.Time `xorm:"-"` + Created time.Time `xorm:"-" json:"-"` CreatedUnix int64 - Updated time.Time `xorm:"-"` + Updated time.Time `xorm:"-" json:"-"` UpdatedUnix int64 // Reference issue in commit message CommitSHA string `xorm:"VARCHAR(40)"` - Attachments []*Attachment `xorm:"-"` + Attachments []*Attachment `xorm:"-" json:"-"` // For view issue page. - ShowTag CommentTag `xorm:"-"` + ShowTag CommentTag `xorm:"-" json:"-"` } func (c *Comment) BeforeInsert() { -- cgit v1.2.3