Files
mattermost/store/sql_upgrade_test.go
Harrison Healey fb6f2a123c PLT-5860 Updated copyright date (#6058)
* PLT-5860 Updated copyright date in about modal

* PLT-5860 Updated copyright notice in JSX files

* PLT-5860 Updated copyright notice in go files

* Fixed misc copyright dates

* Fixed component snapshots
2017-04-12 08:27:57 -04:00

41 lines
881 B
Go

// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package store
import (
"testing"
"github.com/mattermost/platform/model"
)
func TestStoreUpgrade(t *testing.T) {
Setup()
saveSchemaVersion(store.(*SqlStore), VERSION_3_0_0)
UpgradeDatabase(store.(*SqlStore))
store.(*SqlStore).SchemaVersion = ""
UpgradeDatabase(store.(*SqlStore))
}
func TestSaveSchemaVersion(t *testing.T) {
Setup()
saveSchemaVersion(store.(*SqlStore), VERSION_3_0_0)
if result := <-store.System().Get(); result.Err != nil {
t.Fatal(result.Err)
} else {
props := result.Data.(model.StringMap)
if props["Version"] != VERSION_3_0_0 {
t.Fatal("version not updated")
}
}
if store.(*SqlStore).SchemaVersion != VERSION_3_0_0 {
t.Fatal("version not updated")
}
saveSchemaVersion(store.(*SqlStore), model.CurrentVersion)
}