Skip to content

Commit

Permalink
PublicDashboards: Orphaned public dashboard deletion script added (#5…
Browse files Browse the repository at this point in the history
…7917)

* Adds migration to remove orphaned public dashboards.

Co-authored-by: Jeff Levin <jeff@levinology.com>
  • Loading branch information
juanicabanas and jalevin committed Nov 22, 2022
1 parent ee8f292 commit a93b8a0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/services/sqlstore/migrations/dashboard_public_mig.go
Expand Up @@ -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)"))
}

0 comments on commit a93b8a0

Please sign in to comment.