mysql: improved mysql data source, added test feature when adding data source, fixed cache issue

This commit is contained in:
Torkel Ödegaard
2017-05-11 10:50:24 +02:00
parent ab6740c685
commit 4ce0bf4d16
4 changed files with 35 additions and 3 deletions
+3 -1
View File
@@ -149,8 +149,8 @@ func fillWithSecureJsonData(cmd *m.UpdateDataSourceCommand) error {
if err != nil {
return err
}
secureJsonData := ds.SecureJsonData.Decrypt()
secureJsonData := ds.SecureJsonData.Decrypt()
for k, v := range secureJsonData {
if _, ok := cmd.SecureJsonData[k]; !ok {
@@ -158,6 +158,8 @@ func fillWithSecureJsonData(cmd *m.UpdateDataSourceCommand) error {
}
}
// set version from db
cmd.Version = ds.Version
return nil
}
+3 -2
View File
@@ -116,8 +116,9 @@ type UpdateDataSourceCommand struct {
JsonData *simplejson.Json `json:"jsonData"`
SecureJsonData map[string]string `json:"secureJsonData"`
OrgId int64 `json:"-"`
Id int64 `json:"-"`
OrgId int64 `json:"-"`
Id int64 `json:"-"`
Version int `json:"-"`
}
type DeleteDataSourceByIdCommand struct {
+1
View File
@@ -141,6 +141,7 @@ func UpdateDataSource(cmd *m.UpdateDataSourceCommand) error {
JsonData: cmd.JsonData,
SecureJsonData: securejsondata.GetEncryptedJsonData(cmd.SecureJsonData),
Updated: time.Now(),
Version: cmd.Version + 1,
}
sess.UseBool("is_default")