Skip to content

Commit

Permalink
Merge pull request #100 from moul/dev/moul/update
Browse files Browse the repository at this point in the history
fix: tell gorm to not handle the UpdatedAt field
  • Loading branch information
moul authored Oct 7, 2018
2 parents 256f42c + 2ec0c08 commit 98c3f66
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions issue.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ func FromGitLabIssue(input *gitlab.Issue) *Issue {
Labels: make([]*IssueLabel, 0),
Assignees: make([]*Profile, 0),
}
if issue.State == "opened" {
issue.State = "open"
}
for _, label := range input.Labels {
issue.Labels = append(issue.Labels, &IssueLabel{
Name: label,
Expand Down
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package main // import "moul.io/depviz"

import (
"fmt"
"io/ioutil"
"log"
"os"
"strings"

Expand Down Expand Up @@ -75,6 +77,10 @@ func newRootCommand() *cobra.Command {
if err != nil {
return err
}
log.SetOutput(ioutil.Discard)
db.Callback().Create().Remove("gorm:update_time_stamp")
db.Callback().Update().Remove("gorm:update_time_stamp")
log.SetOutput(os.Stderr)
db.SetLogger(zapgorm.New(zap.L().Named("vendor.gorm")))
db = db.Set("gorm:auto_preload", true)
db = db.Set("gorm:association_autoupdate", true)
Expand Down

0 comments on commit 98c3f66

Please sign in to comment.