Added Preferences table to store user preferences
Этот коммит содержится в:
@@ -30,17 +30,18 @@ import (
|
||||
)
|
||||
|
||||
type SqlStore struct {
|
||||
master *gorp.DbMap
|
||||
replicas []*gorp.DbMap
|
||||
team TeamStore
|
||||
channel ChannelStore
|
||||
post PostStore
|
||||
user UserStore
|
||||
audit AuditStore
|
||||
session SessionStore
|
||||
oauth OAuthStore
|
||||
system SystemStore
|
||||
webhook WebhookStore
|
||||
master *gorp.DbMap
|
||||
replicas []*gorp.DbMap
|
||||
team TeamStore
|
||||
channel ChannelStore
|
||||
post PostStore
|
||||
user UserStore
|
||||
audit AuditStore
|
||||
session SessionStore
|
||||
oauth OAuthStore
|
||||
system SystemStore
|
||||
webhook WebhookStore
|
||||
preference PreferenceStore
|
||||
}
|
||||
|
||||
func NewSqlStore() Store {
|
||||
@@ -93,6 +94,7 @@ func NewSqlStore() Store {
|
||||
sqlStore.oauth = NewSqlOAuthStore(sqlStore)
|
||||
sqlStore.system = NewSqlSystemStore(sqlStore)
|
||||
sqlStore.webhook = NewSqlWebhookStore(sqlStore)
|
||||
sqlStore.preference = NewSqlPreferenceStore(sqlStore)
|
||||
|
||||
sqlStore.master.CreateTablesIfNotExists()
|
||||
|
||||
@@ -105,6 +107,7 @@ func NewSqlStore() Store {
|
||||
sqlStore.oauth.(*SqlOAuthStore).UpgradeSchemaIfNeeded()
|
||||
sqlStore.system.(*SqlSystemStore).UpgradeSchemaIfNeeded()
|
||||
sqlStore.webhook.(*SqlWebhookStore).UpgradeSchemaIfNeeded()
|
||||
sqlStore.preference.(*SqlPreferenceStore).UpgradeSchemaIfNeeded()
|
||||
|
||||
sqlStore.team.(*SqlTeamStore).CreateIndexesIfNotExists()
|
||||
sqlStore.channel.(*SqlChannelStore).CreateIndexesIfNotExists()
|
||||
@@ -115,6 +118,7 @@ func NewSqlStore() Store {
|
||||
sqlStore.oauth.(*SqlOAuthStore).CreateIndexesIfNotExists()
|
||||
sqlStore.system.(*SqlSystemStore).CreateIndexesIfNotExists()
|
||||
sqlStore.webhook.(*SqlWebhookStore).CreateIndexesIfNotExists()
|
||||
sqlStore.preference.(*SqlPreferenceStore).CreateIndexesIfNotExists()
|
||||
|
||||
if model.IsPreviousVersion(schemaVersion) {
|
||||
sqlStore.system.Update(&model.System{Name: "Version", Value: model.CurrentVersion})
|
||||
@@ -472,6 +476,10 @@ func (ss SqlStore) Webhook() WebhookStore {
|
||||
return ss.webhook
|
||||
}
|
||||
|
||||
func (ss SqlStore) Preference() PreferenceStore {
|
||||
return ss.preference
|
||||
}
|
||||
|
||||
type mattermConverter struct{}
|
||||
|
||||
func (me mattermConverter) ToDb(val interface{}) (interface{}, error) {
|
||||
|
||||
Ссылка в новой задаче
Block a user