Merge branch 'master' of github.com:lunny/xorm

This commit is contained in:
Lunny Xiao 2014-02-12 15:11:09 +08:00
commit 2373ec2e0b
2 changed files with 7 additions and 16 deletions

View File

@ -1,14 +1,17 @@
## Contributing to xorm ## Contributing to xorm
`xorm` has a backlog of pull requests, but contributions are still very `xorm` has a backlog of [pull requests](https://help.github.com/articles/using-pull-requests), but contributions are still very
much welcome. You can help with patch review, submitting bug reports, much welcome. You can help with patch review, submitting bug reports,
or adding new functionality. There is no formal style guide, but or adding new functionality. There is no formal style guide, but
please conform to the style of existing code and general Go formatting please conform to the style of existing code and general Go formatting
conventions when submitting patches. conventions when submitting patches.
* [fork a repo](https://help.github.com/articles/fork-a-repo)
* [creating a pull request ](https://help.github.com/articles/creating-a-pull-request)
### Patch review ### Patch review
Help review existing open pull requests by commenting on the code or Help review existing open [pull requests](https://help.github.com/articles/using-pull-requests) by commenting on the code or
proposed functionality. proposed functionality.
### Bug reports ### Bug reports

View File

@ -486,8 +486,7 @@ func (engine *Engine) mapType(t reflect.Type) *Table {
var indexType int var indexType int
var indexName string var indexName string
var preKey string var preKey string
for j, ln := 0, len(tags); j < ln; j++ { for j, key := range tags {
key := tags[j]
k := strings.ToUpper(key) k := strings.ToUpper(key)
switch { switch {
case k == "<-": case k == "<-":
@ -538,18 +537,7 @@ func (engine *Engine) mapType(t reflect.Type) *Table {
if preKey != "DEFAULT" { if preKey != "DEFAULT" {
col.Name = key[1 : len(key)-1] col.Name = key[1 : len(key)-1]
} }
} else if strings.Contains(k, "(") && (strings.HasSuffix(k, ")") || strings.HasSuffix(k, ",")) { } else if strings.Contains(k, "(") && strings.HasSuffix(k, ")") {
//[SWH|+]
if strings.HasSuffix(k, ",") {
j++
for j < ln {
k += tags[j]
if strings.HasSuffix(tags[j], ")") {
break
}
j++
}
}
fs := strings.Split(k, "(") fs := strings.Split(k, "(")
if _, ok := sqlTypes[fs[0]]; !ok { if _, ok := sqlTypes[fs[0]]; !ok {
preKey = k preKey = k