diff --git a/src/libs/migrateOnyx.js b/src/libs/migrateOnyx.js index e691ea22ba79..5b4b05598165 100644 --- a/src/libs/migrateOnyx.js +++ b/src/libs/migrateOnyx.js @@ -1,7 +1,6 @@ import _ from 'underscore'; import Log from './Log'; import AddEncryptedAuthToken from './migrations/AddEncryptedAuthToken'; -import RenameActiveClientsKey from './migrations/RenameActiveClientsKey'; import RenamePriorityModeKey from './migrations/RenamePriorityModeKey'; import MoveToIndexedDB from './migrations/MoveToIndexedDB'; import RenameExpensifyNewsStatus from './migrations/RenameExpensifyNewsStatus'; @@ -14,15 +13,7 @@ export default function () { return new Promise((resolve) => { // Add all migrations to an array so they are executed in order - const migrationPromises = [ - MoveToIndexedDB, - RenameActiveClientsKey, - RenamePriorityModeKey, - AddEncryptedAuthToken, - RenameExpensifyNewsStatus, - AddLastVisibleActionCreated, - PersonalDetailsByAccountID, - ]; + const migrationPromises = [MoveToIndexedDB, RenamePriorityModeKey, AddEncryptedAuthToken, RenameExpensifyNewsStatus, AddLastVisibleActionCreated, PersonalDetailsByAccountID]; // 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/RenameActiveClientsKey.js b/src/libs/migrations/RenameActiveClientsKey.js deleted file mode 100644 index 54b36e13cff5..000000000000 --- a/src/libs/migrations/RenameActiveClientsKey.js +++ /dev/null @@ -1,33 +0,0 @@ -import Onyx from 'react-native-onyx'; -import _ from 'underscore'; -import Log from '../Log'; -import ONYXKEYS from '../../ONYXKEYS'; - -// This migration changes the name of the Onyx key ACTIVE_CLIENTS from activeClients2 to activeClients -export default function () { - return new Promise((resolve) => { - // Connect to the old key in Onyx to get the old value of activeClients2 - // then set the new key activeClients to hold the old data - // finally remove the old key by setting the value to null - const connectionID = Onyx.connect({ - key: 'activeClients2', - callback: (oldActiveClients) => { - Onyx.disconnect(connectionID); - - // Fail early here because there is nothing to migrate - if (_.isEmpty(oldActiveClients)) { - Log.info('[Migrate Onyx] Skipped migration RenameActiveClientsKey'); - return resolve(); - } - - Onyx.multiSet({ - activeClients2: null, - [ONYXKEYS.ACTIVE_CLIENTS]: oldActiveClients, - }).then(() => { - Log.info('[Migrate Onyx] Ran migration RenameActiveClientsKey'); - resolve(); - }); - }, - }); - }); -}