mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-04-14 19:47:03 +00:00
temp migration to remove invalid due dates since npmjs is down
This commit is contained in:
parent
3e6eaf6f2f
commit
c6634b5539
1 changed files with 7 additions and 0 deletions
7
migrations/20131104_remove_invalid_dues.js
Normal file
7
migrations/20131104_remove_invalid_dues.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
db.users.find({},{todos:1}).forEach(function(user){
|
||||
_.each(user.todos, function(task){
|
||||
if (moment(task.date).toDate() == 'Invalid Date')
|
||||
task.date = moment().format('MM/DD/YYYY');
|
||||
})
|
||||
db.users.update({_id:user._id}, {$set:{todos: user.todos}});
|
||||
});
|
||||
Loading…
Reference in a new issue