fix only add column if not exists for mysql
This commit is contained in:
@@ -33,6 +33,7 @@ type Dialect interface {
|
||||
UpdateTableSql(tableName string, columns []*Column) string
|
||||
|
||||
IndexCheckSql(tableName, indexName string) (string, []interface{})
|
||||
ColumnCheckSql(tableName, columnName string) (string, []interface{})
|
||||
|
||||
ColString(*Column) string
|
||||
ColStringNoPk(*Column) string
|
||||
@@ -183,6 +184,10 @@ func (db *BaseDialect) RenameTable(oldName string, newName string) string {
|
||||
return fmt.Sprintf("ALTER TABLE %s RENAME TO %s", quote(oldName), quote(newName))
|
||||
}
|
||||
|
||||
func (db *BaseDialect) ColumnCheckSql(tableName, columnName string) (string, []interface{}) {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
func (db *BaseDialect) DropIndexSql(tableName string, index *Index) string {
|
||||
quote := db.dialect.Quote
|
||||
name := index.XName(tableName)
|
||||
|
||||
Reference in New Issue
Block a user