Correct ModifyColumn SQL syntax.
The generated SQL for ModifyColumn was: `ALTER TABLE "tablename" MODIFY "columname" type` But should have been: `ALTER TABLE "tablename" ALTER COLUMN "columname" TYPE type` since Modify does not seem to be entirely compatible with all Engines
This commit is contained in:
parent
b1885a643b
commit
6ee3a97751
2
scope.go
2
scope.go
@ -1139,7 +1139,7 @@ func (scope *Scope) dropTable() *Scope {
|
||||
}
|
||||
|
||||
func (scope *Scope) modifyColumn(column string, typ string) {
|
||||
scope.Raw(fmt.Sprintf("ALTER TABLE %v MODIFY %v %v", scope.QuotedTableName(), scope.Quote(column), typ)).Exec()
|
||||
scope.Raw(fmt.Sprintf("ALTER TABLE %v ALTER COLUMN %v TYPE %v", scope.QuotedTableName(), scope.Quote(column), typ)).Exec()
|
||||
}
|
||||
|
||||
func (scope *Scope) dropColumn(column string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user