diff options
author | Unknwon <joe2010xtmf@163.com> | 2015-02-11 12:43:43 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2015-02-11 12:43:43 -0500 |
commit | c7a042ef3682fce9f343faf5e8d3e4228feabb96 (patch) | |
tree | 4f4f5c295c57930f3a019d4cf7ad84a8d34ef1c8 /models/models.go | |
parent | 767bf82eabed0fede7bbdb5f5b1c75898c6ff00d (diff) | |
parent | e805fdb29cdf8ceabe271a5f26472ae1dc34abff (diff) | |
download | gitea-c7a042ef3682fce9f343faf5e8d3e4228feabb96.tar.gz gitea-c7a042ef3682fce9f343faf5e8d3e4228feabb96.zip |
Merge branch 'access' of github.com:gogits/gogs into access
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/models/models.go b/models/models.go index df030e51bb..1a67041b4a 100644 --- a/models/models.go +++ b/models/models.go @@ -12,6 +12,7 @@ import ( "strings" _ "github.com/go-sql-driver/mysql" + "github.com/go-xorm/core" "github.com/go-xorm/xorm" _ "github.com/lib/pq" @@ -46,7 +47,7 @@ func init() { new(Issue), new(Comment), new(Attachment), new(IssueUser), new(Label), new(Milestone), new(Mirror), new(Release), new(LoginSource), new(Webhook), new(UpdateTask), new(HookTask), new(Team), new(OrgUser), new(TeamUser), - new(Notice), new(EmailAddress)) + new(Notice), new(EmailAddress), new(Collaboration)) } func LoadModelsConfig() { @@ -100,6 +101,7 @@ func NewTestEngine(x *xorm.Engine) (err error) { return fmt.Errorf("connect to database: %v", err) } + x.SetMapper(core.GonicMapper{}) return x.Sync(tables...) } @@ -109,6 +111,8 @@ func SetEngine() (err error) { return fmt.Errorf("connect to database: %v", err) } + x.SetMapper(core.GonicMapper{}) + // WARNING: for serv command, MUST remove the output to os.stdout, // so use log file to instead print to stdout. logPath := path.Join(setting.LogRootPath, "xorm.log") @@ -140,6 +144,7 @@ func NewEngine() (err error) { if err = x.StoreEngine("InnoDB").Sync2(tables...); err != nil { return fmt.Errorf("sync database struct error: %v\n", err) } + return nil } |