mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Previews: fix dashboard.thumbnails.ds_uids migration (#52960)
This commit is contained in:
@@ -128,7 +128,7 @@ func (ss *SQLStore) FindDashboardsWithStaleThumbnails(ctx context.Context, cmd *
|
||||
args := []interface{}{models.ThumbnailStateStale}
|
||||
|
||||
if cmd.IncludeThumbnailsWithEmptyDsUIDs {
|
||||
query += " OR dashboard_thumbnail.ds_uids = ?"
|
||||
query += " OR dashboard_thumbnail.ds_uids = ? OR dashboard_thumbnail.ds_uids IS NULL"
|
||||
args = append(args, "")
|
||||
}
|
||||
sess.Where(query+")", args...)
|
||||
|
||||
@@ -26,6 +26,6 @@ func addDashboardThumbsMigrations(mg *migrator.Migrator) {
|
||||
mg.AddMigration("add unique indexes for dashboard_thumbnail", migrator.NewAddIndexMigration(dashThumbs, dashThumbs.Indices[0]))
|
||||
mg.AddMigration("Add ds_uids column to dashboard_thumbnail table", migrator.NewAddColumnMigration(dashThumbs,
|
||||
// uids of datasources used in the dashboard when taking preview
|
||||
&migrator.Column{Name: "ds_uids", Type: migrator.DB_Text, Nullable: false, Default: ""},
|
||||
&migrator.Column{Name: "ds_uids", Type: migrator.DB_Text, Nullable: true, Default: ""},
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user