diff --git a/imports/api/Users/Users.js b/imports/api/Users/Users.js index 34ade38..aebdc4c 100644 --- a/imports/api/Users/Users.js +++ b/imports/api/Users/Users.js @@ -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 }, diff --git a/imports/startup/server/migrations.js b/imports/startup/server/migrations.js index af33302..f4124d3 100644 --- a/imports/startup/server/migrations.js +++ b/imports/startup/server/migrations.js @@ -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'); });