From 5411291173582d6c34d2777f801272f730a0fc6a Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Sun, 17 Nov 2013 20:38:43 +0800 Subject: [PATCH] Rename UpdateColumn to ModifyColumn --- README.md | 7 ++++++- do.go | 2 +- main.go | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 89077c43..f11cdb69 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/do.go b/do.go index c414aa32..222e4ea1 100644 --- a/do.go +++ b/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() } diff --git a/main.go b/main.go index 84ac2d76..96419162 100644 --- a/main.go +++ b/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 }