mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add FolderUID for library elements (#79572)
* Add FolderUID in missing places for libraryelements * Add migration for FolderUID in library elements table * Add Folder UIDs tolibrary panels * Adjust dashboard import with folder uid * Fix lint * Rename back FolderUID to UID * Remove default * Check if folderUID is nil * Add unique indes on org_id,folder_uid,name and kind * Update pkg/services/libraryelements/database.go Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com> * Fix folder integration test, with unique index on library elements * Make folder uids nullable and rewrite migration query * Use dashboard uid instead of folder_uid * Adjust test --------- Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
@@ -20,6 +20,7 @@ type LibraryElement struct {
|
||||
OrgID int64 `xorm:"org_id"`
|
||||
// Deprecated: use FolderUID instead
|
||||
FolderID int64 `xorm:"folder_id"`
|
||||
FolderUID string `xorm:"folder_uid"`
|
||||
UID string `xorm:"uid"`
|
||||
Name string
|
||||
Kind int64
|
||||
@@ -41,6 +42,7 @@ type LibraryElementWithMeta struct {
|
||||
OrgID int64 `xorm:"org_id"`
|
||||
// Deprecated: use FolderUID instead
|
||||
FolderID int64 `xorm:"folder_id"`
|
||||
FolderUID string `xorm:"folder_uid"`
|
||||
UID string `xorm:"uid"`
|
||||
Name string
|
||||
Kind int64
|
||||
@@ -53,7 +55,6 @@ type LibraryElementWithMeta struct {
|
||||
Updated time.Time
|
||||
|
||||
FolderName string
|
||||
FolderUID string `xorm:"folder_uid"`
|
||||
ConnectedDashboards int64
|
||||
CreatedBy int64
|
||||
UpdatedBy int64
|
||||
@@ -217,13 +218,14 @@ type GetLibraryElementCommand struct {
|
||||
|
||||
// SearchLibraryElementsQuery is the query used for searching for Elements
|
||||
type SearchLibraryElementsQuery struct {
|
||||
PerPage int
|
||||
Page int
|
||||
SearchString string
|
||||
SortDirection string
|
||||
Kind int
|
||||
TypeFilter string
|
||||
ExcludeUID string
|
||||
PerPage int
|
||||
Page int
|
||||
SearchString string
|
||||
SortDirection string
|
||||
Kind int
|
||||
TypeFilter string
|
||||
ExcludeUID string
|
||||
// Deprecated: use FolderFilterUIDs instead
|
||||
FolderFilter string
|
||||
FolderFilterUIDs string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user