fix MSSQL bug on org (#3405)
This commit is contained in:
parent
a0c397df08
commit
97fe773491
28 changed files with 1011 additions and 164 deletions
12
vendor/github.com/go-xorm/xorm/statement.go
generated
vendored
12
vendor/github.com/go-xorm/xorm/statement.go
generated
vendored
|
@ -160,6 +160,9 @@ func (statement *Statement) And(query interface{}, args ...interface{}) *Stateme
|
|||
case string:
|
||||
cond := builder.Expr(query.(string), args...)
|
||||
statement.cond = statement.cond.And(cond)
|
||||
case map[string]interface{}:
|
||||
cond := builder.Eq(query.(map[string]interface{}))
|
||||
statement.cond = statement.cond.And(cond)
|
||||
case builder.Cond:
|
||||
cond := query.(builder.Cond)
|
||||
statement.cond = statement.cond.And(cond)
|
||||
|
@ -181,6 +184,9 @@ func (statement *Statement) Or(query interface{}, args ...interface{}) *Statemen
|
|||
case string:
|
||||
cond := builder.Expr(query.(string), args...)
|
||||
statement.cond = statement.cond.Or(cond)
|
||||
case map[string]interface{}:
|
||||
cond := builder.Eq(query.(map[string]interface{}))
|
||||
statement.cond = statement.cond.Or(cond)
|
||||
case builder.Cond:
|
||||
cond := query.(builder.Cond)
|
||||
statement.cond = statement.cond.Or(cond)
|
||||
|
@ -901,8 +907,12 @@ func (statement *Statement) genDelIndexSQL() []string {
|
|||
|
||||
func (statement *Statement) genAddColumnStr(col *core.Column) (string, []interface{}) {
|
||||
quote := statement.Engine.Quote
|
||||
sql := fmt.Sprintf("ALTER TABLE %v ADD %v;", quote(statement.TableName()),
|
||||
sql := fmt.Sprintf("ALTER TABLE %v ADD %v", quote(statement.TableName()),
|
||||
col.String(statement.Engine.dialect))
|
||||
if statement.Engine.dialect.DBType() == core.MYSQL && len(col.Comment) > 0 {
|
||||
sql += " COMMENT '" + col.Comment + "'"
|
||||
}
|
||||
sql += ";"
|
||||
return sql, []interface{}{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue