зеркало из https://github.com/mozilla/CSOL-site.git
Added migration for signupToken's lastReminder.
This commit is contained in:
Родитель
304a3dde3a
Коммит
daa6b16641
|
@ -33,7 +33,13 @@ signupTokens.findAll({ where: { expired: 0 } }).success(function(activeTokens) {
|
|||
}
|
||||
else {
|
||||
var expireTime = Date.now() + timeToExpiration;
|
||||
var timeRemainingAtLastReminder = expireTime - activeToken.lastReminder.getTime();
|
||||
var timeRemainingAtLastReminder;
|
||||
if (activeToken.lastReminder) {
|
||||
timeRemainingAtLastReminder = expireTime - activeToken.lastReminder.getTime();
|
||||
}
|
||||
else {
|
||||
timeRemainingAtLastReminder = expireTime - activeToken.createdAt.getTime();
|
||||
}
|
||||
|
||||
REMINDER_EMAILS.forEach(function(reminder) {
|
||||
if ((reminder.timeRemaining > timeToExpiration) &&
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
module.exports = {
|
||||
up: function(migration, DataTypes) {
|
||||
migration.addColumn('signuptokens', 'lastReminder', {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true
|
||||
});
|
||||
},
|
||||
down: function(migration) {
|
||||
migration.removeColumn('signuptokens', 'lastReminder');
|
||||
}
|
||||
}
|
|
@ -25,7 +25,6 @@ module.exports = {
|
|||
},
|
||||
lastReminder: {
|
||||
type: db.type.DATE,
|
||||
defaultValue: db.type.NOW,
|
||||
allowNull: true
|
||||
}
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче