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
@@ -39,11 +39,14 @@ func (m *FolderUIDMigration) Exec(sess *xorm.Session, mgrtr *migrator.Migrator)
}
// for folders the source of truth is the folder table
// covered by UQE_folder_org_id_uid
q = `UPDATE dashboard
SET folder_uid = folder.parent_uid
FROM folder
WHERE dashboard.uid = folder.uid AND dashboard.org_id = folder.org_id
AND dashboard.is_folder = ?`
// covered by UQE_folder_org_id_uid
if mgrtr.Dialect.DriverName() == migrator.MySQL {
q = `UPDATE dashboard
SET folder_uid = (