refactoring: moved compare dashboard version command out of sqlstore, the code in this command did not use any sql operations and was more high level, could be moved out and use existing queries to get the versions

This commit is contained in:
Torkel Ödegaard
2017-06-06 00:14:40 +02:00
parent e43d09e15b
commit e2061312f5
7 changed files with 156 additions and 198 deletions

View File

@@ -7,14 +7,6 @@ import (
"github.com/grafana/grafana/pkg/components/simplejson"
)
type DiffType int
const (
DiffJSON DiffType = iota
DiffBasic
DiffDelta
)
var (
ErrDashboardVersionNotFound = errors.New("Dashboard version not found")
ErrNoVersionsForDashboardId = errors.New("No dashboard versions found for the given DashboardId")
@@ -77,18 +69,3 @@ type GetDashboardVersionsQuery struct {
Result []*DashboardVersionDTO
}
//
// Commands
//
// CompareDashboardVersionsCommand is used to compare two versions.
type CompareDashboardVersionsCommand struct {
OrgId int64
DashboardId int64
BaseVersion int
NewVersion int
DiffType DiffType
Delta []byte `json:"delta"`
}