mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
chore: Change v3 migration to use _legacyId instead of legacyId
This commit is contained in:
@@ -129,16 +129,16 @@ function processChallenges (afterId) {
|
||||
|
||||
oldTasks.forEach(function (oldTask) {
|
||||
oldTask._id = uuid.v4();
|
||||
oldTask.legacyId = oldTask.id; // store the old task id
|
||||
oldTask._legacyId = oldTask.id; // store the old task id
|
||||
delete oldTask.id;
|
||||
|
||||
oldTask.challenge = oldTask.challenge || {};
|
||||
oldTask.challenge.id = newChallenge._id;
|
||||
|
||||
if (newTasksIds[oldTask.legacyId + '-' + newChallenge._id]) {
|
||||
if (newTasksIds[oldTask._legacyId + '-' + newChallenge._id]) {
|
||||
throw new Error('duplicate :(');
|
||||
} else {
|
||||
newTasksIds[oldTask.legacyId + '-' + newChallenge._id] = oldTask._id;
|
||||
newTasksIds[oldTask._legacyId + '-' + newChallenge._id] = oldTask._id;
|
||||
}
|
||||
|
||||
oldTask.tags = _.map(oldTask.tags || {}, function (tagPresent, tagId) {
|
||||
|
||||
Reference in New Issue
Block a user