Added telegramBot to user info

This commit is contained in:
vjrj 2018-03-06 17:58:25 +01:00
parent f7d118de27
commit 4fafaf8ed5
2 changed files with 13 additions and 1 deletions

View file

@ -106,6 +106,7 @@ const schemaUser = new SimpleSchema({
'name.first': String,
'name.last': String, */
lang: { type: String, optional: true },
telegramBot: { type: String, optional: true },
telegramChatId: { type: SimpleSchema.Integer, optional: true },
telegramUsername: { type: String, optional: true },
telegramFirstName: { type: String, optional: true },

View file

@ -164,8 +164,19 @@ Meteor.startup(() => {
}
});
Migrations.add({
version: 12,
up: function setTelegramUsersBotId() {
Meteor.users.update({ telegramChatId: { $ne: null }, telegramBot: null }, {
$set: {
telegramBot: 'es'
}
});
}
});
// Set createdAt in users & subs
Migrations.migrateTo('latest');
// Migrations.migrateTo('7,rerun');
// Migrations.migrateTo('12,rerun');
});