Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions commands/migrate.js
Original file line number Diff line number Diff line change
@@ -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 <source> <transformer> <destination>')
.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.')
Expand All @@ -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);
});
};