mirror of https://github.com/go-gorm/gorm.git
Allow table option when DropTable, close #1514
This commit is contained in:
parent
30adc80edc
commit
8005321a1c
4
scope.go
4
scope.go
|
@ -1079,7 +1079,7 @@ func (scope *Scope) getTableOptions() string {
|
|||
if !ok {
|
||||
return ""
|
||||
}
|
||||
return tableOptions.(string)
|
||||
return " " + tableOptions.(string)
|
||||
}
|
||||
|
||||
func (scope *Scope) createJoinTable(field *StructField) {
|
||||
|
@ -1154,7 +1154,7 @@ func (scope *Scope) createTable() *Scope {
|
|||
}
|
||||
|
||||
func (scope *Scope) dropTable() *Scope {
|
||||
scope.Raw(fmt.Sprintf("DROP TABLE %v", scope.QuotedTableName())).Exec()
|
||||
scope.Raw(fmt.Sprintf("DROP TABLE %v%s", scope.QuotedTableName(), scope.getTableOptions())).Exec()
|
||||
return scope
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue