diff --git a/cmd/flatten_report.go b/cmd/flatten_report.go index 323bfee..c1c0b5f 100644 --- a/cmd/flatten_report.go +++ b/cmd/flatten_report.go @@ -18,6 +18,12 @@ func FlattenReport(report *model.Report) *model.FlatReport { changes = append(changes, change) } flatReport.Changes = changes + + // Copy the Commit information from the report to the flatReport and then delete the changes + flatReport.Commit = &model.Commit{} + *flatReport.Commit = *report.Commit + flatReport.Commit.Changes = nil + return flatReport } diff --git a/model/report.go b/model/report.go index ca0e2b6..2de6fc6 100644 --- a/model/report.go +++ b/model/report.go @@ -20,6 +20,7 @@ type Report struct { type FlatReport struct { Summary map[string]*reports.Changed `json:"reportSummary"` Changes []*model.Change `json:"changes"` + Commit *Commit `gorm:"foreignKey:ID" json:"commitDetails"` } type FlatHistoricalReport struct {