mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Merge pull request #983 from mattermost/fix-db-upgrade
Fixing db upgrade for 1.1
This commit is contained in:
@@ -38,6 +38,8 @@ func NewSqlChannelStore(sqlStore *SqlStore) ChannelStore {
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) UpgradeSchemaIfNeeded() {
|
||||
|
||||
// BEGIN REMOVE AFTER 1.1.0
|
||||
if s.CreateColumnIfNotExists("ChannelMembers", "NotifyProps", "varchar(2000)", "varchar(2000)", "{}") {
|
||||
// populate NotifyProps from existing NotifyLevel field
|
||||
|
||||
@@ -80,6 +82,7 @@ func (s SqlChannelStore) UpgradeSchemaIfNeeded() {
|
||||
|
||||
s.RemoveColumnIfExists("ChannelMembers", "NotifyLevel")
|
||||
}
|
||||
// END REMOVE AFTER 1.1.0
|
||||
}
|
||||
|
||||
func (s SqlChannelStore) CreateIndexesIfNotExists() {
|
||||
|
||||
@@ -84,13 +84,6 @@ func NewSqlStore() Store {
|
||||
}
|
||||
}
|
||||
|
||||
// Temporary upgrade code, remove after 0.8.0 release
|
||||
if sqlStore.DoesTableExist("Sessions") {
|
||||
if sqlStore.DoesColumnExist("Sessions", "AltId") {
|
||||
sqlStore.GetMaster().Exec("DROP TABLE IF EXISTS Sessions")
|
||||
}
|
||||
}
|
||||
|
||||
sqlStore.team = NewSqlTeamStore(sqlStore)
|
||||
sqlStore.channel = NewSqlChannelStore(sqlStore)
|
||||
sqlStore.post = NewSqlPostStore(sqlStore)
|
||||
|
||||
@@ -28,7 +28,6 @@ func NewSqlTeamStore(sqlStore *SqlStore) TeamStore {
|
||||
}
|
||||
|
||||
func (s SqlTeamStore) UpgradeSchemaIfNeeded() {
|
||||
s.RemoveColumnIfExists("Teams", "AllowValet")
|
||||
}
|
||||
|
||||
func (s SqlTeamStore) CreateIndexesIfNotExists() {
|
||||
|
||||
@@ -41,7 +41,6 @@ func NewSqlUserStore(sqlStore *SqlStore) UserStore {
|
||||
}
|
||||
|
||||
func (us SqlUserStore) UpgradeSchemaIfNeeded() {
|
||||
us.CreateColumnIfNotExists("Users", "ThemeProps", "varchar(2000)", "character varying(2000)", "{}")
|
||||
}
|
||||
|
||||
func (us SqlUserStore) CreateIndexesIfNotExists() {
|
||||
|
||||
Reference in New Issue
Block a user