fix: set schemaVersion on dashboard schema (CUE) (#87712)

* fix: set schemaVersion on dashboard schema (CUE)

* docs: add comment to migration code

* fix: run make gen-cue
This commit is contained in:
Jeroen Op 't Eynde
2024-05-28 16:16:20 +02:00
committed by GitHub
parent ef07dfa3bb
commit e1685cb44b
3 changed files with 6 additions and 2 deletions

View File

@@ -74,7 +74,7 @@ lineage: schemas: [{
// Version of the JSON schema, incremented each time a Grafana update brings
// changes to said schema.
schemaVersion: uint16 | *36
schemaVersion: uint16 | *39
// Version of the dashboard, incremented each time the dashboard is updated.
version?: uint32

View File

@@ -1182,7 +1182,7 @@ export const defaultDashboard: Partial<Dashboard> = {
graphTooltip: DashboardCursorSync.Off,
links: [],
panels: [],
schemaVersion: 36,
schemaVersion: 39,
tags: [],
timezone: 'browser',
};

View File

@@ -76,6 +76,10 @@ type PanelSchemeUpgradeHandler = (panel: PanelModel) => PanelModel;
* To add a dashboard migration increment this number
* and then add your migration at the bottom of 'updateSchema'
* hint: search "Add migration here"
*
* This number also needs to be updated on the CUE schema:
* kinds/dashboard/dashboard_kind.cue
* Example PR: #87712
*/
export const DASHBOARD_SCHEMA_VERSION = 39;
export class DashboardMigrator {