diff --git a/pkg/services/sqlstore/migrations.go b/pkg/services/sqlstore/migrations.go index 3c9c27a0918..0b7a540015b 100644 --- a/pkg/services/sqlstore/migrations.go +++ b/pkg/services/sqlstore/migrations.go @@ -47,9 +47,6 @@ func addUserMigrations(mg *Migrator) { &Column{Name: "updated", Type: DB_DateTime, Nullable: false}, )) - mg.AddMigration("Add email_verified flag", new(AddColumnMigration). - Table("user").Column(&Column{Name: "email_verified", Type: DB_Bool, Nullable: true})) - mg.AddMigration("Add email_verified flag", new(AddColumnMigration). Table("user").Column(&Column{Name: "email_verified", Type: DB_Bool, Nullable: true})) diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index a2db1a6fec8..9cb571c479d 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -98,15 +98,10 @@ var ( func init() { IsWindows = runtime.GOOS == "windows" log.NewLogger(0, "console", `{"level": 0}`) -} - -func getWorkDir() string { - p, _ := filepath.Abs(".") - return p + WorkDir, _ = filepath.Abs(".") } func findConfigFiles() []string { - WorkDir = getWorkDir() ConfRootPath = path.Join(WorkDir, "conf") filenames := make([]string, 0) @@ -152,6 +147,10 @@ func ToAbsUrl(relativeUrl string) string { return AppUrl + relativeUrl } +func loadEnvVariableOverrides() { + +} + func NewConfigContext() { configFiles := findConfigFiles() @@ -170,6 +169,8 @@ func NewConfigContext() { } } + loadEnvVariableOverrides() + AppName = Cfg.Section("").Key("app_name").MustString("Grafana") Env = Cfg.Section("").Key("app_mode").MustString("development") diff --git a/pkg/setting/setting_test.go b/pkg/setting/setting_test.go new file mode 100644 index 00000000000..22ffbc17edb --- /dev/null +++ b/pkg/setting/setting_test.go @@ -0,0 +1,22 @@ +package setting + +import ( + "path/filepath" + "testing" + + . "github.com/smartystreets/goconvey/convey" +) + +func TestLoadingSettings(t *testing.T) { + + WorkDir, _ = filepath.Abs("../../") + + Convey("Testing loading settings from ini file", t, func() { + + Convey("Given the default ini files", func() { + NewConfigContext() + + So(AppName, ShouldEqual, "Grafana") + }) + }) +}