mirror of https://github.com/go-gorm/gorm.git
Rename UpdateColumn to ModifyColumn
This commit is contained in:
parent
c62568c089
commit
5411291173
|
@ -780,8 +780,13 @@ db.Where("email = ?", "x@example.org").Attrs(User{RegisteredIp: "111.111.111.111
|
|||
```
|
||||
|
||||
## TODO
|
||||
* Scopes, Valiations, Includes, Joins, UpdateColumn/Columns
|
||||
* UpdateColumn/Columns
|
||||
* Scopes
|
||||
* Joins
|
||||
* Scan
|
||||
* AlertColumn, DropColumn, AddIndex, RemoveIndex
|
||||
* Includes
|
||||
* Valiations
|
||||
|
||||
# Author
|
||||
|
||||
|
|
2
do.go
2
do.go
|
@ -678,7 +678,7 @@ func (s *Do) dropTable() *Do {
|
|||
return s
|
||||
}
|
||||
|
||||
func (s *Do) updateColumn(column string, typ string) {
|
||||
func (s *Do) modifyColumn(column string, typ string) {
|
||||
s.sql = fmt.Sprintf("ALTER TABLE %v MODIFY %v %v", s.table(), column, typ)
|
||||
s.exec()
|
||||
}
|
||||
|
|
4
main.go
4
main.go
|
@ -235,8 +235,8 @@ func (s *DB) AutoMigrate(value interface{}) *DB {
|
|||
return s.clone().do(value).autoMigrate().db
|
||||
}
|
||||
|
||||
func (s *DB) UpdateColumn(column string, typ string) *DB {
|
||||
s.clone().do(s.data).updateColumn(column, typ)
|
||||
func (s *DB) ModifyColumn(column string, typ string) *DB {
|
||||
s.clone().do(s.data).modifyColumn(column, typ)
|
||||
return s
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue