summaryrefslogtreecommitdiffstats
path: root/store/sql_channel_store.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-11-09 15:25:41 -0500
committerChristopher Speller <crspeller@gmail.com>2015-11-09 15:25:41 -0500
commitbb9615796077d4adb6d4bbe2b9e8f0e655254ec1 (patch)
treec7ae633e14ac2fd363c7010a7f957fea69147a74 /store/sql_channel_store.go
parentb0fde13147a84ee06e349eeff7d18e5e37980fc2 (diff)
downloadchat-bb9615796077d4adb6d4bbe2b9e8f0e655254ec1.tar.gz
chat-bb9615796077d4adb6d4bbe2b9e8f0e655254ec1.tar.bz2
chat-bb9615796077d4adb6d4bbe2b9e8f0e655254ec1.zip
Removing old DB upgrade code
Diffstat (limited to 'store/sql_channel_store.go')
-rw-r--r--store/sql_channel_store.go49
1 files changed, 0 insertions, 49 deletions
diff --git a/store/sql_channel_store.go b/store/sql_channel_store.go
index 2d62b8614..6fcad5dc2 100644
--- a/store/sql_channel_store.go
+++ b/store/sql_channel_store.go
@@ -40,55 +40,6 @@ func NewSqlChannelStore(sqlStore *SqlStore) ChannelStore {
}
func (s SqlChannelStore) UpgradeSchemaIfNeeded() {
-
- // REMOVE AFTER 1.2 SHIP see PLT-828
- if s.CreateColumnIfNotExists("ChannelMembers", "NotifyProps", "varchar(2000)", "varchar(2000)", "{}") {
- // populate NotifyProps from existing NotifyLevel field
-
- // set default values
- _, err := s.GetMaster().Exec(
- `UPDATE
- ChannelMembers
- SET
- NotifyProps = CONCAT('{"desktop":"', CONCAT(NotifyLevel, '","mark_unread":"` + model.CHANNEL_MARK_UNREAD_ALL + `"}'))`)
- if err != nil {
- l4g.Error("Unable to set default values for ChannelMembers.NotifyProps")
- l4g.Error(err.Error())
- }
-
- // assume channels with all notifications enabled are just using the default settings
- _, err = s.GetMaster().Exec(
- `UPDATE
- ChannelMembers
- SET
- NotifyProps = '{"desktop":"` + model.CHANNEL_NOTIFY_DEFAULT + `","mark_unread":"` + model.CHANNEL_MARK_UNREAD_ALL + `"}'
- WHERE
- NotifyLevel = '` + model.CHANNEL_NOTIFY_ALL + `'`)
- if err != nil {
- l4g.Error("Unable to set values for ChannelMembers.NotifyProps when members previously had notifyLevel=all")
- l4g.Error(err.Error())
- }
-
- // set quiet mode channels to have no notifications and only mark the channel unread on mentions
- _, err = s.GetMaster().Exec(
- `UPDATE
- ChannelMembers
- SET
- NotifyProps = '{"desktop":"` + model.CHANNEL_NOTIFY_NONE + `","mark_unread":"` + model.CHANNEL_MARK_UNREAD_MENTION + `"}'
- WHERE
- NotifyLevel = 'quiet'`)
- if err != nil {
- l4g.Error("Unable to set values for ChannelMembers.NotifyProps when members previously had notifyLevel=quiet")
- l4g.Error(err.Error())
- }
-
- s.RemoveColumnIfExists("ChannelMembers", "NotifyLevel")
- }
-
- // BEGIN REMOVE AFTER 1.2.0
- s.RenameColumnIfExists("Channels", "Description", "Header", "varchar(1024)")
- s.CreateColumnIfNotExists("Channels", "Purpose", "varchar(1024)", "varchar(1024)", "")
- // END REMOVE AFTER 1.2.0
}
func (s SqlChannelStore) CreateIndexesIfNotExists() {