Merge branch 'master' of github.com:go-xorm/xorm
This commit is contained in:
commit
e9059acd4d
|
@ -373,12 +373,14 @@ func (engine *Engine) DumpAll(w io.Writer) error {
|
|||
} else if col.SQLType.IsText() || col.SQLType.IsTime() {
|
||||
var v = fmt.Sprintf("%s", d)
|
||||
temp += ", '" + strings.Replace(v, "'", "''", -1) + "'"
|
||||
} else if col.SQLType.IsBlob() /**/ {
|
||||
} else if col.SQLType.IsBlob() {
|
||||
if reflect.TypeOf(d).Kind() == reflect.Slice {
|
||||
temp += fmt.Sprintf(", %s", engine.dialect.FormatBytes(d.([]byte)))
|
||||
} else if reflect.TypeOf(d).Kind() == reflect.String {
|
||||
temp += fmt.Sprintf(", '%s'", d.(string))
|
||||
}
|
||||
} else if col.SQLType.IsNumeric() {
|
||||
temp += fmt.Sprintf(", %s", string(d.([]byte)))
|
||||
} else {
|
||||
s := fmt.Sprintf("%v", d)
|
||||
if strings.Contains(s, ":") || strings.Contains(s, "-") {
|
||||
|
|
|
@ -168,7 +168,7 @@ where a.object_id=object_id('` + tableName + `')`
|
|||
}
|
||||
}
|
||||
|
||||
if col.SQLType.IsText() {
|
||||
if col.SQLType.IsText() || col.SQLType.IsTime() {
|
||||
if col.Default != "" {
|
||||
col.Default = "'" + col.Default + "'"
|
||||
} else {
|
||||
|
|
|
@ -228,7 +228,7 @@ func (db *mysql) GetColumns(tableName string) ([]string, map[string]*core.Column
|
|||
col.IsAutoIncrement = true
|
||||
}
|
||||
|
||||
if col.SQLType.IsText() {
|
||||
if col.SQLType.IsText() || col.SQLType.IsTime() {
|
||||
if col.Default != "" {
|
||||
col.Default = "'" + col.Default + "'"
|
||||
} else {
|
||||
|
|
|
@ -158,7 +158,7 @@ func (db *oracle) GetColumns(tableName string) ([]string, map[string]*core.Colum
|
|||
|
||||
col.Length = dataLen
|
||||
|
||||
if col.SQLType.IsText() {
|
||||
if col.SQLType.IsText() || col.SQLType.IsTime() {
|
||||
if col.Default != "" {
|
||||
col.Default = "'" + col.Default + "'"
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue