Folders: Switch order of the columns in folder table indexes so that org_id becomes first (#82454)

* Folders: Switch order of the columns in folder table so that org_id becomes first
This commit is contained in:
Sofia Papagiannaki
2024-02-16 21:10:46 +02:00
committed by GitHub
parent c6f8462a06
commit 38e8c62972
8 changed files with 77 additions and 18 deletions
@@ -38,6 +38,7 @@ func (b *Builder) ToSQL(limit, page int64) (string, []any) {
b.sql.WriteString("\n")
if b.Features.IsEnabledGlobally(featuremgmt.FlagNestedFolders) {
// covered by UQE_folder_org_id_uid
b.sql.WriteString(
`LEFT OUTER JOIN folder ON folder.uid = dashboard.folder_uid AND folder.org_id = dashboard.org_id`)
} else {
@@ -180,6 +180,7 @@ func TestBuilder_RBAC(t *testing.T) {
},
features: featuremgmt.WithFeatures(featuremgmt.FlagNestedFolders),
expectedParams: []any{
int64(1),
int64(1),
int64(1),
0,
@@ -191,6 +192,7 @@ func TestBuilder_RBAC(t *testing.T) {
2,
int64(1),
int64(1),
int64(1),
0,
"Viewer",
int64(1),
@@ -255,6 +257,7 @@ func TestBuilder_RBAC(t *testing.T) {
},
features: featuremgmt.WithFeatures(featuremgmt.FlagNestedFolders, featuremgmt.FlagPermissionsFilterRemoveSubquery),
expectedParams: []any{
int64(1),
int64(1),
int64(1),
0,
@@ -266,6 +269,7 @@ func TestBuilder_RBAC(t *testing.T) {
2,
int64(1),
int64(1),
int64(1),
0,
"Viewer",
int64(1),