-
Notifications
You must be signed in to change notification settings - Fork 891
/
visualization_migrations.ts
804 lines (723 loc) · 24.8 KB
/
visualization_migrations.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Any modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { SavedObjectMigrationFn } from 'opensearch-dashboards/server';
import { cloneDeep, get, omit, has, flow } from 'lodash';
import { DEFAULT_QUERY_LANGUAGE } from '../../../data/common';
const migrateIndexPattern: SavedObjectMigrationFn<any, any> = (doc) => {
const searchSourceJSON = get(doc, 'attributes.kibanaSavedObjectMeta.searchSourceJSON');
if (typeof searchSourceJSON !== 'string') {
return doc;
}
let searchSource;
try {
searchSource = JSON.parse(searchSourceJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
return doc;
}
if (searchSource.index && Array.isArray(doc.references)) {
searchSource.indexRefName = 'kibanaSavedObjectMeta.searchSourceJSON.index';
doc.references.push({
name: searchSource.indexRefName,
type: 'index-pattern',
id: searchSource.index,
});
delete searchSource.index;
}
if (searchSource.filter) {
searchSource.filter.forEach((filterRow: any, i: number) => {
if (!filterRow.meta || !filterRow.meta.index || !Array.isArray(doc.references)) {
return;
}
filterRow.meta.indexRefName = `kibanaSavedObjectMeta.searchSourceJSON.filter[${i}].meta.index`;
doc.references.push({
name: filterRow.meta.indexRefName,
type: 'index-pattern',
id: filterRow.meta.index,
});
delete filterRow.meta.index;
});
}
doc.attributes.kibanaSavedObjectMeta.searchSourceJSON = JSON.stringify(searchSource);
return doc;
};
// [TSVB] Migrate percentile-rank aggregation (value -> values)
const migratePercentileRankAggregation: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
let visState;
if (visStateJSON) {
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (visState && visState.type === 'metrics') {
const series: any[] = get(visState, 'params.series') || [];
series.forEach((part) => {
(part.metrics || []).forEach((metric: any) => {
if (metric.type === 'percentile_rank' && has(metric, 'value')) {
metric.values = [metric.value];
delete metric.value;
}
});
});
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
}
return doc;
};
// [TSVB] Replace string query with object
const migrateFilterRatioQuery: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
let visState;
if (visStateJSON) {
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (visState && visState.type === 'metrics') {
const series: any[] = get(visState, 'params.series') || [];
series.forEach((part) => {
(part.metrics || []).forEach((metric: any) => {
if (metric.type === 'filter_ratio') {
if (typeof metric.numerator === 'string') {
metric.numerator = { query: metric.numerator, language: 'lucene' };
}
if (typeof metric.denominator === 'string') {
metric.denominator = { query: metric.denominator, language: 'lucene' };
}
}
});
});
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
}
return doc;
};
// [TSVB] Remove stale opperator key
const migrateOperatorKeyTypo: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
let visState;
if (visStateJSON) {
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (visState && visState.type === 'metrics') {
const gaugeColorRules: any[] = get(visState, 'params.gauge_color_rules') || [];
gaugeColorRules.forEach((colorRule) => {
if (colorRule.opperator) {
delete colorRule.opperator;
}
});
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
}
return doc;
};
/**
* Moving setting wether to do a row or column split to vis.params
*
* @see https://github.com/elastic/kibana/pull/58462/files#diff-ae69fe15b20a5099d038e9bbe2ed3849
**/
const migrateSplitByChartRow: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
let visState: any;
if (visStateJSON) {
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (visState && visState.aggs && visState.params) {
let row: boolean | undefined;
visState.aggs.forEach((agg: any) => {
if (agg.type === 'terms' && agg.schema === 'split' && 'row' in agg.params) {
row = agg.params.row;
delete agg.params.row;
}
});
if (row !== undefined) {
visState.params.row = row;
}
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
}
return doc;
};
// Migrate date histogram aggregation (remove customInterval)
const migrateDateHistogramAggregation: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
let visState;
if (visStateJSON) {
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (visState && visState.aggs) {
visState.aggs.forEach((agg: any) => {
if (agg.type === 'date_histogram' && agg.params) {
if (agg.params.interval === 'custom') {
agg.params.interval = agg.params.customInterval;
}
delete agg.params.customInterval;
}
if (
get(agg, 'params.customBucket.type', null) === 'date_histogram' &&
agg.params.customBucket.params
) {
if (agg.params.customBucket.params.interval === 'custom') {
agg.params.customBucket.params.interval = agg.params.customBucket.params.customInterval;
}
delete agg.params.customBucket.params.customInterval;
}
});
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
}
return doc;
};
const removeDateHistogramTimeZones: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
if (visStateJSON) {
let visState;
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (visState && visState.aggs) {
visState.aggs.forEach((agg: any) => {
// We're checking always for the existance of agg.params here. This should always exist, but better
// be safe then sorry during migrations.
if (agg.type === 'date_histogram' && agg.params) {
delete agg.params.time_zone;
}
if (
get(agg, 'params.customBucket.type', null) === 'date_histogram' &&
agg.params.customBucket.params
) {
delete agg.params.customBucket.params.time_zone;
}
});
doc.attributes.visState = JSON.stringify(visState);
}
}
return doc;
};
// migrate gauge verticalSplit to alignment
// https://github.com/elastic/kibana/issues/34636
const migrateGaugeVerticalSplitToAlignment: SavedObjectMigrationFn<any, any> = (doc, logger) => {
const visStateJSON = get(doc, 'attributes.visState');
if (visStateJSON) {
try {
const visState = JSON.parse(visStateJSON);
if (visState && visState.type === 'gauge' && !visState.params.gauge.alignment) {
visState.params.gauge.alignment = visState.params.gauge.verticalSplit
? 'vertical'
: 'horizontal';
delete visState.params.gauge.verticalSplit;
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
} catch (e) {
logger.log.warn(`Exception @ migrateGaugeVerticalSplitToAlignment! ${e}`);
logger.log.warn(`Exception @ migrateGaugeVerticalSplitToAlignment! Payload: ${visStateJSON}`);
}
}
return doc;
};
// Migrate filters (string -> { query: string, language: lucene })
/*
Enabling DQL in TSVB causes problems with savedObject visualizations when these are saved with filters.
In a visualisation type of saved object, if the visState param is of type metric, the filter is saved as a string that is not interpretted correctly as a lucene query in the visualization itself.
We need to transform the filter string into an object containing the original string as a query and specify the query language as lucene.
For Metrics visualizations (param.type === "metric"), filters can be applied to each series object in the series array within the SavedObject.visState.params object.
Path to the series array is thus:
attributes.visState.
*/
const transformFilterStringToQueryObject: SavedObjectMigrationFn<any, any> = (doc, logger) => {
// Migrate filters
// If any filters exist and they are a string, we assume it to be lucene and transform the filter into an object accordingly
const newDoc = cloneDeep(doc);
const visStateJSON = get(doc, 'attributes.visState');
if (visStateJSON) {
let visState;
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// let it go, the data is invalid and we'll leave it as is
}
if (visState) {
const visType = get(visState, 'params.type');
const tsvbTypes = ['metric', 'markdown', 'top_n', 'gauge', 'table', 'timeseries'];
if (tsvbTypes.indexOf(visType) === -1) {
// skip
return doc;
}
// migrate the params fitler
const params: any = get(visState, 'params');
if (params.filter && typeof params.filter === 'string') {
const paramsFilterObject = {
query: params.filter,
language: 'lucene',
};
params.filter = paramsFilterObject;
}
// migrate the annotations query string:
const annotations: any[] = get(visState, 'params.annotations') || [];
annotations.forEach((item) => {
if (!item.query_string) {
// we don't need to transform anything if there isn't a filter at all
return;
}
if (typeof item.query_string === 'string') {
const itemQueryStringObject = {
query: item.query_string,
language: 'lucene',
};
item.query_string = itemQueryStringObject;
}
});
// migrate the series filters
const series: any[] = get(visState, 'params.series') || [];
series.forEach((item) => {
if (!item.filter) {
// we don't need to transform anything if there isn't a filter at all
return;
}
// series item filter
if (typeof item.filter === 'string') {
const itemfilterObject = {
query: item.filter,
language: 'lucene',
};
item.filter = itemfilterObject;
}
// series item split filters filter
if (item.split_filters) {
const splitFilters: any[] = get(item, 'split_filters') || [];
splitFilters.forEach((filter) => {
if (!filter.filter) {
// we don't need to transform anything if there isn't a filter at all
return;
}
if (typeof filter.filter === 'string') {
const filterfilterObject = {
query: filter.filter,
language: 'lucene',
};
filter.filter = filterfilterObject;
}
});
}
});
newDoc.attributes.visState = JSON.stringify(visState);
}
}
return newDoc;
};
const transformSplitFiltersStringToQueryObject: SavedObjectMigrationFn<any, any> = (doc) => {
// Migrate split_filters in TSVB objects that weren't migrated in 7.3
// If any filters exist and they are a string, we assume them to be lucene syntax and transform the filter into an object accordingly
const newDoc = cloneDeep(doc);
const visStateJSON = get(doc, 'attributes.visState');
if (visStateJSON) {
let visState;
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// let it go, the data is invalid and we'll leave it as is
}
if (visState) {
const visType = get(visState, 'params.type');
const tsvbTypes = ['metric', 'markdown', 'top_n', 'gauge', 'table', 'timeseries'];
if (tsvbTypes.indexOf(visType) === -1) {
// skip
return doc;
}
// migrate the series split_filter filters
const series: any[] = get(visState, 'params.series') || [];
series.forEach((item) => {
// series item split filters filter
if (item.split_filters) {
const splitFilters: any[] = get(item, 'split_filters') || [];
if (splitFilters.length > 0) {
// only transform split_filter filters if we have filters
splitFilters.forEach((filter) => {
if (typeof filter.filter === 'string') {
const filterfilterObject = {
query: filter.filter,
language: 'lucene',
};
filter.filter = filterfilterObject;
}
});
}
}
});
newDoc.attributes.visState = JSON.stringify(visState);
}
}
return newDoc;
};
const migrateFiltersAggQuery: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
if (visStateJSON) {
try {
const visState = JSON.parse(visStateJSON);
if (visState && visState.aggs) {
visState.aggs.forEach((agg: any) => {
if (agg.type !== 'filters') return;
agg.params.filters.forEach((filter: any) => {
if (filter.input.language) return filter;
filter.input.language = 'lucene';
});
});
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
}
return doc;
};
const replaceMovAvgToMovFn: SavedObjectMigrationFn<any, any> = (doc, logger) => {
const visStateJSON = get(doc, 'attributes.visState');
let visState;
if (visStateJSON) {
try {
visState = JSON.parse(visStateJSON);
if (visState && visState.type === 'metrics') {
const series: any[] = get(visState, 'params.series', []);
series.forEach((part) => {
if (part.metrics && Array.isArray(part.metrics)) {
part.metrics.forEach((metric: any) => {
if (metric.type === 'moving_average') {
metric.model_type = metric.model;
metric.alpha = get(metric, 'settings.alpha', 0.3);
metric.beta = get(metric, 'settings.beta', 0.1);
metric.gamma = get(metric, 'settings.gamma', 0.3);
metric.period = get(metric, 'settings.period', 1);
metric.multiplicative = get(metric, 'settings.type') === 'mult';
delete metric.minimize;
delete metric.model;
delete metric.settings;
delete metric.predict;
}
});
}
});
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
} catch (e) {
logger.log.warn(`Exception @ replaceMovAvgToMovFn! ${e}`);
logger.log.warn(`Exception @ replaceMovAvgToMovFn! Payload: ${visStateJSON}`);
}
}
return doc;
};
const migrateFiltersAggQueryStringQueries: SavedObjectMigrationFn<any, any> = (doc, logger) => {
const visStateJSON = get(doc, 'attributes.visState');
if (visStateJSON) {
try {
const visState = JSON.parse(visStateJSON);
if (visState && visState.aggs) {
visState.aggs.forEach((agg: any) => {
if (agg.type !== 'filters') return doc;
agg.params.filters.forEach((filter: any) => {
if (filter.input.query.query_string) {
filter.input.query = filter.input.query.query_string.query;
}
});
});
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
}
return doc;
};
const addDocReferences: SavedObjectMigrationFn<any, any> = (doc) => ({
...doc,
references: doc.references || [],
});
const migrateSavedSearch: SavedObjectMigrationFn<any, any> = (doc) => {
const savedSearchId = get(doc, 'attributes.savedSearchId');
if (savedSearchId && doc.references) {
doc.references.push({
type: 'search',
name: 'search_0',
id: savedSearchId,
});
doc.attributes.savedSearchRefName = 'search_0';
}
delete doc.attributes.savedSearchId;
return doc;
};
const migrateControls: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
if (visStateJSON) {
let visState;
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (visState) {
const controls: any[] = get(visState, 'params.controls') || [];
controls.forEach((control, i) => {
if (!control.indexPattern || !doc.references) {
return;
}
control.indexPatternRefName = `control_${i}_index_pattern`;
doc.references.push({
name: control.indexPatternRefName,
type: 'index-pattern',
id: control.indexPattern,
});
delete control.indexPattern;
});
doc.attributes.visState = JSON.stringify(visState);
}
}
return doc;
};
const migrateTableSplits: SavedObjectMigrationFn<any, any> = (doc) => {
try {
const visState = JSON.parse(doc.attributes.visState);
if (get(visState, 'type') !== 'table') {
return doc; // do nothing; we only want to touch tables
}
let splitCount = 0;
visState.aggs = visState.aggs.map((agg: any) => {
if (agg.schema !== 'split') {
return agg;
}
splitCount++;
if (splitCount === 1) {
return agg; // leave the first split agg unchanged
}
agg.schema = 'bucket';
// the `row` param is exclusively used by split aggs, so we remove it
agg.params = omit(agg.params, ['row']);
return agg;
});
if (splitCount <= 1) {
return doc; // do nothing; we only want to touch tables with multiple split aggs
}
const newDoc = cloneDeep(doc);
newDoc.attributes.visState = JSON.stringify(visState);
return newDoc;
} catch (e) {
throw new Error(`Failure attempting to migrate saved object '${doc.attributes.title}' - ${e}`);
}
};
/**
* This migration script is related to:
* @link https://github.com/elastic/kibana/pull/62194
* @link https://github.com/elastic/kibana/pull/14644
* This is only a problem when you import an object from 5.x into 6.x but to be sure that all saved objects migrated we should execute it twice in 6.7.2 and 7.9.3
*/
const migrateMatchAllQuery: SavedObjectMigrationFn<any, any> = (doc) => {
const searchSourceJSON = get(doc, 'attributes.kibanaSavedObjectMeta.searchSourceJSON');
if (searchSourceJSON) {
let searchSource: any;
try {
searchSource = JSON.parse(searchSourceJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
return doc;
}
if (searchSource.query?.match_all) {
return {
...doc,
attributes: {
...doc.attributes,
kibanaSavedObjectMeta: {
searchSourceJSON: JSON.stringify({
...searchSource,
query: {
query: '',
language: DEFAULT_QUERY_LANGUAGE,
},
}),
},
},
};
}
}
return doc;
};
// [TSVB] Default color palette is changing, keep the default for older viz
const migrateTsvbDefaultColorPalettes: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
let visState;
if (visStateJSON) {
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (visState && visState.type === 'metrics') {
const series: any[] = get(visState, 'params.series') || [];
series.forEach((part) => {
// The default value was not saved before
if (!part.split_color_mode) {
part.split_color_mode = 'gradient';
}
});
return {
...doc,
attributes: {
...doc.attributes,
visState: JSON.stringify(visState),
},
};
}
}
return doc;
};
// [TSVB] Remove serialized search source as it's not used in TSVB visualizations
const removeTSVBSearchSource: SavedObjectMigrationFn<any, any> = (doc) => {
const visStateJSON = get(doc, 'attributes.visState');
let visState;
const searchSourceJSON = get(doc, 'attributes.kibanaSavedObjectMeta.searchSourceJSON');
if (visStateJSON) {
try {
visState = JSON.parse(visStateJSON);
} catch (e) {
// Let it go, the data is invalid and we'll leave it as is
}
if (visState && visState.type === 'metrics' && searchSourceJSON !== '{}') {
return {
...doc,
attributes: {
...doc.attributes,
kibanaSavedObjectMeta: {
...get(doc, 'attributes.kibanaSavedObjectMeta'),
searchSourceJSON: '{}',
},
},
};
}
}
return doc;
};
export const visualizationSavedObjectTypeMigrations = {
/**
* We need to have this migration twice, once with a version prior to 7.0.0 once with a version
* after it. The reason for that is, that this migration has been introduced once 7.0.0 was already
* released. Thus a user who already had 7.0.0 installed already got the 7.0.0 migrations below running,
* so we need a version higher than that. But this fix was backported to the 6.7 release, meaning if we
* would only have the 7.0.1 migration in here a user on the 6.7 release will migrate their saved objects
* to the 7.0.1 state, and thus when updating their OpenSearch Dashboards to 7.0, will never run the 7.0.0 migrations introduced
* in that version. So we apply this twice, once with 6.7.2 and once with 7.0.1 while the backport to 6.7
* only contained the 6.7.2 migration and not the 7.0.1 migration.
*/
'6.7.2': flow(migrateMatchAllQuery, removeDateHistogramTimeZones),
'7.0.0': flow(
addDocReferences,
migrateIndexPattern,
migrateSavedSearch,
migrateControls,
migrateTableSplits
),
'7.0.1': flow(removeDateHistogramTimeZones),
'7.2.0': flow(migratePercentileRankAggregation, migrateDateHistogramAggregation),
'7.3.0': flow(
migrateGaugeVerticalSplitToAlignment,
transformFilterStringToQueryObject,
migrateFiltersAggQuery,
replaceMovAvgToMovFn
),
'7.3.1': flow(migrateFiltersAggQueryStringQueries),
'7.4.2': flow(transformSplitFiltersStringToQueryObject),
'7.7.0': flow(migrateOperatorKeyTypo, migrateSplitByChartRow),
'7.8.0': flow(migrateTsvbDefaultColorPalettes),
'7.9.3': flow(migrateMatchAllQuery),
'7.10.0': flow(migrateFilterRatioQuery, removeTSVBSearchSource),
};