summaryrefslogtreecommitdiffstats
path: root/store/sql_status_store.go
diff options
context:
space:
mode:
authorDmitri Aizenberg <dmitri.aiz@gmail.com>2016-08-31 06:24:14 -0700
committerJoram Wilander <jwawilander@gmail.com>2016-08-31 09:24:14 -0400
commitdc09b7781ac310646014f05db23844ab2c6d63f4 (patch)
tree906f13501b8e30be3551fa18078429445e5ee094 /store/sql_status_store.go
parentdb660bdf9cbea09197d8292a8ec8efda8ac41f38 (diff)
downloadchat-dc09b7781ac310646014f05db23844ab2c6d63f4.tar.gz
chat-dc09b7781ac310646014f05db23844ab2c6d63f4.tar.bz2
chat-dc09b7781ac310646014f05db23844ab2c6d63f4.zip
PLT-1527 Add a slash command to set yourself away (#3752)
* added handlers for slash commands * added manual status persistance * added tests * removed extra debug output and comments * rebase - fixing the PR * making echo messages after slash commands ephemeral
Diffstat (limited to 'store/sql_status_store.go')
-rw-r--r--store/sql_status_store.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/store/sql_status_store.go b/store/sql_status_store.go
index f5259c212..99d89f0d5 100644
--- a/store/sql_status_store.go
+++ b/store/sql_status_store.go
@@ -5,6 +5,7 @@ package store
import (
"database/sql"
+
"github.com/mattermost/platform/model"
)
@@ -22,12 +23,17 @@ func NewSqlStatusStore(sqlStore *SqlStore) StatusStore {
for _, db := range sqlStore.GetAllConns() {
table := db.AddTableWithName(model.Status{}, "Status").SetKeys(false, "UserId")
table.ColMap("UserId").SetMaxSize(26)
+ table.ColMap("Manual")
table.ColMap("Status").SetMaxSize(32)
}
return s
}
+func (s SqlStatusStore) UpgradeSchemaIfNeeded() {
+ s.CreateColumnIfNotExists("Status", "Manual", "BOOLEAN", "BOOLEAN", "0")
+}
+
func (s SqlStatusStore) CreateIndexesIfNotExists() {
s.CreateIndexIfNotExists("idx_status_user_id", "Status", "UserId")
s.CreateIndexIfNotExists("idx_status_status", "Status", "Status")