fix(plugin-workflow): fix migration (#1479)
* fix(plugin-workflow): fix migration * fix(plugin-workflow): fix migration * fix(plugin-workflow): change migration name to trigger
This commit is contained in:
parent
f6dad11441
commit
33f6bb4c63
@ -26,7 +26,7 @@ function migrateData(input) {
|
|||||||
|
|
||||||
export default class extends Migration {
|
export default class extends Migration {
|
||||||
async up() {
|
async up() {
|
||||||
const match = await this.app.version.satisfies('<=0.9.0-alpha.2');
|
const match = await this.app.version.satisfies('<0.9.0-alpha.3');
|
||||||
if (!match) {
|
if (!match) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
@ -49,13 +49,13 @@ const calculatorsMap = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function migrateConfig({ calculation }) {
|
function migrateConfig({ calculation, ...config }: any = {}) {
|
||||||
if (!calculation?.calculator || !calculation?.operands?.length) {
|
if (!calculation?.calculator || !calculation?.operands?.length) {
|
||||||
return {};
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculator = calculatorsMap[calculation.calculator];
|
const calculator = calculatorsMap[calculation.calculator];
|
||||||
const operands = calculator.operands.map(operand => addQuote(operand));
|
const operands = (calculator.operands ?? []).map(operand => addQuote(operand));
|
||||||
|
|
||||||
return {
|
return {
|
||||||
engine: 'formula.js',
|
engine: 'formula.js',
|
||||||
@ -67,7 +67,7 @@ function migrateConfig({ calculation }) {
|
|||||||
|
|
||||||
export default class extends Migration {
|
export default class extends Migration {
|
||||||
async up() {
|
async up() {
|
||||||
const match = await this.app.version.satisfies('<=0.9.0-alpha.2');
|
const match = await this.app.version.satisfies('<0.9.0-alpha.3');
|
||||||
if (!match) {
|
if (!match) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
@ -44,7 +44,7 @@ function migrateConfig({ group: { type = 'and', calculations = [] } }) {
|
|||||||
|
|
||||||
export default class extends Migration {
|
export default class extends Migration {
|
||||||
async up() {
|
async up() {
|
||||||
const match = await this.app.version.satisfies('<=0.9.0-alpha.2');
|
const match = await this.app.version.satisfies('<0.9.0-alpha.3');
|
||||||
if (!match) {
|
if (!match) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user