summaryrefslogtreecommitdiffstats
path: root/store/sql_user_store.go
diff options
context:
space:
mode:
authorhmhealey <harrisonmhealey@gmail.com>2015-07-09 13:59:19 -0400
committerhmhealey <harrisonmhealey@gmail.com>2015-07-17 15:13:24 -0400
commitc09f1b9e4e5638080622ff9aa70735db382a16df (patch)
treea05d7d71d87cf436c30424a2f34e0cb0db9aaff1 /store/sql_user_store.go
parent1d7509493e65324d1e81bf39c51a9d7c07335c56 (diff)
downloadchat-c09f1b9e4e5638080622ff9aa70735db382a16df.tar.gz
chat-c09f1b9e4e5638080622ff9aa70735db382a16df.tar.bz2
chat-c09f1b9e4e5638080622ff9aa70735db382a16df.zip
Renamed FullName column in database to Nickname. Renamed all serverside references from FullName to Nickname.
Diffstat (limited to 'store/sql_user_store.go')
-rw-r--r--store/sql_user_store.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/store/sql_user_store.go b/store/sql_user_store.go
index 665e4d697..9e1cc9331 100644
--- a/store/sql_user_store.go
+++ b/store/sql_user_store.go
@@ -25,7 +25,7 @@ func NewSqlUserStore(sqlStore *SqlStore) UserStore {
table.ColMap("Password").SetMaxSize(128)
table.ColMap("AuthData").SetMaxSize(128)
table.ColMap("Email").SetMaxSize(128)
- table.ColMap("FullName").SetMaxSize(64)
+ table.ColMap("Nickname").SetMaxSize(64)
table.ColMap("Roles").SetMaxSize(64)
table.ColMap("Props").SetMaxSize(4000)
table.ColMap("NotifyProps").SetMaxSize(2000)
@@ -36,10 +36,15 @@ func NewSqlUserStore(sqlStore *SqlStore) UserStore {
return us
}
-func (s SqlUserStore) UpgradeSchemaIfNeeded() {
- s.CreateColumnIfNotExists("Users","LastPictureUpdate", "LastPasswordUpdate", "bigint(20)", "0")
+func (us SqlUserStore) UpgradeSchemaIfNeeded() {
+ us.CreateColumnIfNotExists("Users", "LastPictureUpdate", "LastPasswordUpdate", "bigint(20)", "0")
+
+ // migrating the FullName column to Nickname for MM-825
+ us.RenameColumnIfExists("Users", "FullName", "Nickname", "varchar(64)")
}
+//func (ss SqlStore) CreateColumnIfNotExists(tableName string, columnName string, afterName string, colType string, defaultValue string) bool {
+
func (us SqlUserStore) CreateIndexesIfNotExists() {
us.CreateIndexIfNotExists("idx_team_id", "Users", "TeamId")
}