fixed
This commit is contained in:
parent
a18c751d44
commit
22c515f1e0
|
@ -30,11 +30,12 @@ type Column struct {
|
|||
IsCascade bool
|
||||
IsVersion bool
|
||||
fieldPath []string
|
||||
DefaultIsEmpty bool
|
||||
}
|
||||
|
||||
func NewColumn(name, fieldName string, sqlType SQLType, len1, len2 int, nullable bool) *Column {
|
||||
return &Column{name, fieldName, sqlType, len1, len2, nullable, "", make(map[string]bool), false, false,
|
||||
TWOSIDES, false, false, false, false, nil}
|
||||
TWOSIDES, false, false, false, false, nil, false}
|
||||
}
|
||||
|
||||
// generate column description string according dialect
|
||||
|
|
11
dialect.go
11
dialect.go
|
@ -1,6 +1,7 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
@ -29,6 +30,8 @@ type Dialect interface {
|
|||
SqlType(t *Column) string
|
||||
SupportInsertMany() bool
|
||||
QuoteStr() string
|
||||
RollBackStr() string
|
||||
DropTableSql(tableName string) string
|
||||
AutoIncrStr() string
|
||||
SupportEngine() bool
|
||||
SupportCharset() bool
|
||||
|
@ -83,6 +86,14 @@ func (b *Base) Quote(c string) string {
|
|||
return b.dialect.QuoteStr() + c + b.dialect.QuoteStr()
|
||||
}
|
||||
|
||||
func (db *Base) RollBackStr() string {
|
||||
return "ROLL BACK"
|
||||
}
|
||||
|
||||
func (db *Base) DropTableSql(tableName string) string {
|
||||
return fmt.Sprintf("DROP TABLE IF EXISTS `%s`", tableName)
|
||||
}
|
||||
|
||||
func (b *Base) CreateTableSql(table *Table, tableName, storeEngine, charset string) string {
|
||||
var sql string
|
||||
sql = "CREATE TABLE IF NOT EXISTS "
|
||||
|
|
Loading…
Reference in New Issue