mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* 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
41 lines
881 B
Go
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)
|
|
}
|