From 1f559ed3b9a7df50e76fadc2fab9346c1889f04f Mon Sep 17 00:00:00 2001 From: Yauheni Balashka Date: Thu, 6 Aug 2026 10:48:55 +0300 Subject: [PATCH] FIO-11531: Deprecate the migrate command --- commands/migrate.js | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/commands/migrate.js b/commands/migrate.js index 9e5dc7e..0408144 100644 --- a/commands/migrate.js +++ b/commands/migrate.js @@ -1,11 +1,22 @@ 'use strict'; -var series = require('../src/series'); +const series = require('../src/series'); + +const DEPRECATION_WARNING ='WARNING: This command is deprecated, and will be removed in the near future. ' + + 'Please review available commands for alternatives.'; module.exports = function(program, next) { + const action = series([ + require('../src/authenticate')({ + src: 0, + dst: 2 + }), + require('../src/migrate') + ], next); + program .command('migrate ') - .description('Migrate data from a source (CSV or Form) to a destination form.') + .description('(DEPRECATED) Migrate data from a source (CSV or Form) to a destination form.') .option('-p, --protocol [protocol]', 'Change the protocol.') .option('-h, --host [host]', 'Set the host for the copy.') .option('--key [key]', 'The API Key to provide to the destination forms.') @@ -23,11 +34,8 @@ module.exports = function(program, next) { .option('--delete-previous [deletePrevious]', 'Deletes previous submissions that have been migrated with the migrate script.') .option('--delete-after [deleteAfter]', 'Provides the ability to delete submissions created in the Source after the provided timestamp. The timestamp should be in the format of 2022-05-30T12:00:00.000Z. Use with delete-before to create a delete "window".') .option('--delete-before [deleteBefore]', 'Provides the ability to delete submissions created in the Before after the provided timestamp. The timestamp should be in the format of 2022-05-30T12:00:00.000Z. Use with delete-after to create a delete "window".') - .action(series([ - require('../src/authenticate')({ - src: 0, - dst: 2 - }), - require('../src/migrate') - ], next)); + .action(function() { + console.log(DEPRECATION_WARNING.yellow); + action.apply(this, arguments); + }); };