Upgrade xorm to v0.7.9 to fix some bugs (#8354)

* upgrade xorm to v0.7.9 to fix some bugs

* upgrade xormstore to v1.3.1
This commit is contained in:
Lunny Xiao 2019-10-03 04:47:20 +08:00 committed by techknowlogick
parent 3be43dc5e3
commit c9f819eae0
15 changed files with 381 additions and 238 deletions

View file

@ -345,9 +345,9 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*core.Column
if colDefault != nil {
col.Default = *colDefault
if col.Default == "" {
col.DefaultIsEmpty = true
}
col.DefaultIsEmpty = false
} else {
col.DefaultIsEmpty = true
}
cts := strings.Split(colType, "(")
@ -411,13 +411,11 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*core.Column
col.IsAutoIncrement = true
}
if col.SQLType.IsText() || col.SQLType.IsTime() {
if col.Default != "" {
if !col.DefaultIsEmpty {
if col.SQLType.IsText() {
col.Default = "'" + col.Default + "'"
} else if col.SQLType.IsTime() && col.Default != "CURRENT_TIMESTAMP" {
col.Default = "'" + col.Default + "'"
} else {
if col.DefaultIsEmpty {
col.Default = "''"
}
}
}
cols[col.Name] = col