diff options
Diffstat (limited to 'store/sql_store.go')
-rw-r--r-- | store/sql_store.go | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/store/sql_store.go b/store/sql_store.go index 4b055e455..692ac2664 100644 --- a/store/sql_store.go +++ b/store/sql_store.go @@ -16,17 +16,18 @@ import ( "encoding/json" "errors" "fmt" - "github.com/go-gorp/gorp" - _ "github.com/go-sql-driver/mysql" - _ "github.com/lib/pq" - "github.com/mattermost/platform/model" - "github.com/mattermost/platform/utils" "io" sqltrace "log" "math/rand" "os" "strings" "time" + + "github.com/go-gorp/gorp" + _ "github.com/go-sql-driver/mysql" + _ "github.com/lib/pq" + "github.com/mattermost/platform/model" + "github.com/mattermost/platform/utils" ) type SqlStore struct { @@ -179,6 +180,17 @@ func (ss SqlStore) GetCurrentSchemaVersion() string { return version } +func (ss SqlStore) MarkSystemRanUnitTests() { + if result := <-ss.System().Get(); result.Err == nil { + props := result.Data.(model.StringMap) + unitTests := props[model.SYSTEM_RAN_UNIT_TESTS] + if len(unitTests) == 0 { + systemTests := &model.System{Name: model.SYSTEM_RAN_UNIT_TESTS, Value: "1"} + <-ss.System().Save(systemTests) + } + } +} + func (ss SqlStore) DoesTableExist(tableName string) bool { if utils.Cfg.SqlSettings.DriverName == model.DATABASE_DRIVER_POSTGRES { count, err := ss.GetMaster().SelectInt( |