diff --git a/src/libs/migrateOnyx.js b/src/libs/migrateOnyx.js index d96a37d95457..aaa706e71fb2 100644 --- a/src/libs/migrateOnyx.js +++ b/src/libs/migrateOnyx.js @@ -1,6 +1,5 @@ import _ from 'underscore'; import Log from './Log'; -import RenamePriorityModeKey from './migrations/RenamePriorityModeKey'; import PersonalDetailsByAccountID from './migrations/PersonalDetailsByAccountID'; import RenameReceiptFilename from './migrations/RenameReceiptFilename'; @@ -10,7 +9,7 @@ export default function () { return new Promise((resolve) => { // Add all migrations to an array so they are executed in order - const migrationPromises = [RenamePriorityModeKey, PersonalDetailsByAccountID, RenameReceiptFilename]; + const migrationPromises = [PersonalDetailsByAccountID, RenameReceiptFilename]; // Reduce all promises down to a single promise. All promises run in a linear fashion, waiting for the // previous promise to finish before moving onto the next one. diff --git a/src/libs/migrations/RenamePriorityModeKey.js b/src/libs/migrations/RenamePriorityModeKey.js deleted file mode 100644 index a2be26880b52..000000000000 --- a/src/libs/migrations/RenamePriorityModeKey.js +++ /dev/null @@ -1,33 +0,0 @@ -import Onyx from 'react-native-onyx'; -import _ from 'underscore'; -import ONYXKEYS from '../../ONYXKEYS'; -import Log from '../Log'; - -// This migration changes the name of the Onyx key NVP_PRIORITY_MODE from priorityMode to nvp_priorityMode -export default function () { - return new Promise((resolve) => { - // Connect to the old key in Onyx to get the old value of priorityMode - // then set the new key nvp_priorityMode to hold the old data - // finally remove the old key by setting the value to null - const connectionID = Onyx.connect({ - key: 'priorityMode', - callback: (oldPriorityMode) => { - Onyx.disconnect(connectionID); - - // Fail early here because there is nothing to migrate - if (_.isEmpty(oldPriorityMode)) { - Log.info('[Migrate Onyx] Skipped migration RenamePriorityModeKey'); - return resolve(); - } - - Onyx.multiSet({ - priorityMode: null, - [ONYXKEYS.NVP_PRIORITY_MODE]: oldPriorityMode, - }).then(() => { - Log.info('[Migrate Onyx] Ran migration RenamePriorityModeKey'); - resolve(); - }); - }, - }); - }); -}