summaryrefslogtreecommitdiffstats
path: root/store/sql_store.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-10-15 11:16:26 -0700
committer=Corey Hulen <corey@hulen.com>2015-10-15 11:16:26 -0700
commitde717aef56dfaa0b9b676ce82d4b9d7abdb12428 (patch)
treee35cbb702a1c6d508f3295865739186a1b3f44c9 /store/sql_store.go
parentadc20981e2c370f09467d4fa249065d23f533a0a (diff)
downloadchat-de717aef56dfaa0b9b676ce82d4b9d7abdb12428.tar.gz
chat-de717aef56dfaa0b9b676ce82d4b9d7abdb12428.tar.bz2
chat-de717aef56dfaa0b9b676ce82d4b9d7abdb12428.zip
Marking when user ran the unit tests
Diffstat (limited to 'store/sql_store.go')
-rw-r--r--store/sql_store.go22
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(