Final work on migration, now there is no usage of xorm table sync

This commit is contained in:
Torkel Ödegaard
2015-01-20 14:44:37 +01:00
parent afb847acc8
commit 0a695ba17a
7 changed files with 37 additions and 6 deletions
@@ -15,6 +15,7 @@ type Dialect interface {
EqStr() string
ShowCreateNull() bool
SqlType(col *Column) string
SupportEngine() bool
CreateIndexSql(tableName string, index *Index) string
CreateTableSql(table *Table) string
@@ -85,6 +86,10 @@ func (b *BaseDialect) CreateTableSql(table *Table) string {
}
sql = sql[:len(sql)-2] + ")"
if b.dialect.SupportEngine() {
sql += " ENGINE=InnoDB DEFAULT CHARSET UTF8 "
}
sql += ";"
return sql
}
@@ -13,6 +13,10 @@ func NewMysqlDialect() *Mysql {
return &d
}
func (db *Mysql) SupportEngine() bool {
return true
}
func (db *Mysql) Quote(name string) string {
return "`" + name + "`"
}
@@ -13,6 +13,10 @@ func NewPostgresDialect() *Postgres {
return &d
}
func (db *Postgres) SupportEngine() bool {
return false
}
func (db *Postgres) Quote(name string) string {
return "\"" + name + "\""
}
@@ -11,6 +11,10 @@ func NewSqlite3Dialect() *Sqlite3 {
return &d
}
func (db *Sqlite3) SupportEngine() bool {
return false
}
func (db *Sqlite3) Quote(name string) string {
return "`" + name + "`"
}