Initialize stmt.Schema in RunWithValue when value is a table name string
This commit is contained in:
parent
aeb298635b
commit
2e770fbd25
@ -55,6 +55,9 @@ func (m Migrator) RunWithValue(value interface{}, fc func(*gorm.Statement) error
|
||||
|
||||
if table, ok := value.(string); ok {
|
||||
stmt.Table = table
|
||||
if err := stmt.Parse(value); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if err := stmt.ParseWithSpecialTableName(value, stmt.Table); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user