forked from mirror/gorm
Add table options
This commit is contained in:
parent
56bdded0f8
commit
1fdc66710e
|
@ -203,6 +203,11 @@ func (m Migrator) CreateTable(values ...interface{}) error {
|
||||||
createTableSQL = strings.TrimSuffix(createTableSQL, ",")
|
createTableSQL = strings.TrimSuffix(createTableSQL, ",")
|
||||||
|
|
||||||
createTableSQL += ")"
|
createTableSQL += ")"
|
||||||
|
|
||||||
|
if tableOption, ok := m.DB.Get("gorm:table_options"); ok {
|
||||||
|
createTableSQL += fmt.Sprint(tableOption)
|
||||||
|
}
|
||||||
|
|
||||||
return tx.Exec(createTableSQL, values...).Error
|
return tx.Exec(createTableSQL, values...).Error
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue