PublicDashboards: Orphaned public dashboard deletion script added (#57917)

* Adds migration to remove orphaned public dashboards.

Co-authored-by: Jeff Levin <jeff@levinology.com>
This commit is contained in:
juanicabanas 2022-11-22 19:11:06 -03:00 committed by GitHub
parent ee8f292c6a
commit a93b8a03cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -74,4 +74,7 @@ func addPublicDashboardMigration(mg *Migrator) {
Nullable: false,
Default: "0",
}))
mg.AddMigration("delete orphaned public dashboards", NewRawSQLMigration(
"DELETE FROM dashboard_public WHERE dashboard_uid NOT IN (SELECT uid FROM dashboard)"))
}