Migrating users without lang

This commit is contained in:
vjrj 2018-02-13 09:24:56 +01:00
parent dfed8d3a74
commit add5dedcb1

View file

@ -104,8 +104,21 @@ Meteor.startup(() => {
}
});
Migrations.add({
version: 7,
up: function defLangIfNull() {
Meteor.users.find({ lang: null }).forEach((user) => {
Meteor.users.update({ _id: user._id }, {
$set: {
lang: 'es'
}
});
});
}
});
// Set createdAt in users & subs
Migrations.migrateTo('latest');
// Migrations.migrateTo('5,rerun');
// Migrations.migrateTo('7,rerun');
});