fix: fix migration

This commit is contained in:
Marta Bondyra 2020-04-30 15:42:56 +02:00
parent cf43f13a28
commit 99b5982f1c
2 changed files with 3 additions and 3 deletions

View file

@ -160,7 +160,7 @@ describe('Lens migrations', () => {
});
describe('7.8.0 auto timestamp', () => {
const context = {} as SavedObjectMigrationContext;
const context = ({ log: { warning: () => {} } } as unknown) as SavedObjectMigrationContext;
const example = {
type: 'lens',

View file

@ -4,7 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import { cloneDeep, flow } from 'lodash';
import { cloneDeep } from 'lodash';
import { fromExpression, toExpression, Ast, ExpressionFunctionAST } from '@kbn/interpreter/common';
import { SavedObjectMigrationFn } from 'src/core/server';
@ -153,5 +153,5 @@ export const migrations: Record<string, SavedObjectMigrationFn> = {
},
// The order of these migrations matter, since the timefield migration relies on the aggConfigs
// sitting directly on the esaggs as an argument and not a nested function (which lens_auto_date was).
'7.8.0': flow(removeLensAutoDate, addTimeFieldToEsaggs),
'7.8.0': (doc, context) => addTimeFieldToEsaggs(removeLensAutoDate(doc, context), context),
};