mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
fix MSSQL bug on org (#3405)
This commit is contained in:
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{}{}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user