mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
CloudWatch: Fix broken queries for users migrating from 8.2.4/8.2.5 to 8.3.0 (#42611)
* move migration logic to a higher version number * bump version in test
This commit is contained in:
@@ -179,7 +179,7 @@ describe('DashboardModel', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('dashboard schema version should be set to latest', () => {
|
it('dashboard schema version should be set to latest', () => {
|
||||||
expect(model.schemaVersion).toBe(33);
|
expect(model.schemaVersion).toBe(34);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('graph thresholds should be migrated', () => {
|
it('graph thresholds should be migrated', () => {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export class DashboardMigrator {
|
|||||||
let i, j, k, n;
|
let i, j, k, n;
|
||||||
const oldVersion = this.dashboard.schemaVersion;
|
const oldVersion = this.dashboard.schemaVersion;
|
||||||
const panelUpgrades: PanelSchemeUpgradeHandler[] = [];
|
const panelUpgrades: PanelSchemeUpgradeHandler[] = [];
|
||||||
this.dashboard.schemaVersion = 33;
|
this.dashboard.schemaVersion = 34;
|
||||||
|
|
||||||
if (oldVersion === this.dashboard.schemaVersion) {
|
if (oldVersion === this.dashboard.schemaVersion) {
|
||||||
return;
|
return;
|
||||||
@@ -692,12 +692,7 @@ export class DashboardMigrator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oldVersion < 32) {
|
if (oldVersion < 32) {
|
||||||
panelUpgrades.push((panel: PanelModel) => {
|
// CloudWatch migrations have been moved to version 34
|
||||||
this.migrateCloudWatchQueries(panel);
|
|
||||||
return panel;
|
|
||||||
});
|
|
||||||
|
|
||||||
this.migrateCloudWatchAnnotationQuery();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace datasource name with reference, uid and type
|
// Replace datasource name with reference, uid and type
|
||||||
@@ -727,6 +722,15 @@ export class DashboardMigrator {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (oldVersion < 34) {
|
||||||
|
panelUpgrades.push((panel: PanelModel) => {
|
||||||
|
this.migrateCloudWatchQueries(panel);
|
||||||
|
return panel;
|
||||||
|
});
|
||||||
|
|
||||||
|
this.migrateCloudWatchAnnotationQuery();
|
||||||
|
}
|
||||||
|
|
||||||
if (panelUpgrades.length === 0) {
|
if (panelUpgrades.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user