oracle 11g
This commit is contained in:
@ -3,9 +3,10 @@ package oracle
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"gorm.io/gorm/schema"
|
||||
"strings"
|
||||
|
||||
"gorm.io/gorm/schema"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/clause"
|
||||
"gorm.io/gorm/migrator"
|
||||
@ -275,11 +276,10 @@ func (m Migrator) HasIndex(value interface{}, name string) bool {
|
||||
|
||||
// https://docs.oracle.com/database/121/SPATL/alter-index-rename.htm
|
||||
func (m Migrator) RenameIndex(value interface{}, oldName, newName string) error {
|
||||
panic("TODO")
|
||||
return m.RunWithValue(value, func(stmt *gorm.Statement) error {
|
||||
return m.DB.Exec(
|
||||
"ALTER INDEX ?.? RENAME TO ?", // wat
|
||||
clause.Table{Name: stmt.Table}, clause.Column{Name: oldName}, clause.Column{Name: newName},
|
||||
"ALTER INDEX ? RENAME TO ?", // wat
|
||||
clause.Column{Name: oldName}, clause.Column{Name: newName},
|
||||
).Error
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user