diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-09-01 16:01:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-01 16:01:58 -0400 |
commit | 949e57076aa41584b4104abc2bed98c5f9d91165 (patch) | |
tree | f8158bf5937b214dab44ee3904764ce87564f50d /store | |
parent | 2b14e422aaccd1ceb20e485301bf3109977b160f (diff) | |
download | chat-949e57076aa41584b4104abc2bed98c5f9d91165.tar.gz chat-949e57076aa41584b4104abc2bed98c5f9d91165.tar.bz2 chat-949e57076aa41584b4104abc2bed98c5f9d91165.zip |
Fix status table upgrade (#3933)
Diffstat (limited to 'store')
-rw-r--r-- | store/sql_status_store.go | 5 | ||||
-rw-r--r-- | store/sql_upgrade.go | 12 |
2 files changed, 5 insertions, 12 deletions
diff --git a/store/sql_status_store.go b/store/sql_status_store.go index 99d89f0d5..9b82484f4 100644 --- a/store/sql_status_store.go +++ b/store/sql_status_store.go @@ -23,17 +23,12 @@ 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") diff --git a/store/sql_upgrade.go b/store/sql_upgrade.go index 293d1ce6b..954139128 100644 --- a/store/sql_upgrade.go +++ b/store/sql_upgrade.go @@ -179,12 +179,10 @@ func UpgradeDatabaseToVersion33(sqlStore *SqlStore) { } func UpgradeDatabaseToVersion34(sqlStore *SqlStore) { - // TODO XXX FIXME should be removed before release - //if shouldPerformUpgrade(sqlStore, VERSION_3_3_0, VERSION_3_4_0) { + if shouldPerformUpgrade(sqlStore, VERSION_3_3_0, VERSION_3_4_0) { + sqlStore.CreateColumnIfNotExists("Status", "Manual", "BOOLEAN", "BOOLEAN", "0") - // do the actual upgrade - - // TODO XXX FIXME should be removed before release - //saveSchemaVersion(sqlStore, VERSION_3_4_0) - //} + // TODO XXX FIXME should be removed before release + //saveSchemaVersion(sqlStore, VERSION_3_4_0) + } } |