diff --git a/orm/cmd_utils.go b/orm/cmd_utils.go index 13e6fe59..8e1d3fdb 100644 --- a/orm/cmd_utils.go +++ b/orm/cmd_utils.go @@ -148,6 +148,10 @@ func getDbCreateSql(al *alias) (sqls []string, tableIndexes map[string][]dbIndex column += " " + "NOT NULL" } + if fi.initial.String() != "" { + column += " DEFAULT " + fi.initial.String() + } + if fi.unique { column += " " + "UNIQUE" } diff --git a/router.go b/router.go index c6900473..0fc8a387 100644 --- a/router.go +++ b/router.go @@ -603,7 +603,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) if !findrouter { if t, ok := p.routers[r.Method]; ok { - runObject, p := t.Match(r.URL.Path) + runObject, p := t.Match(strings.ToLower(r.URL.Path)) if r, ok := runObject.(*controllerInfo); ok { routerInfo = r findrouter = true