- Introduced a new field `lastNobilityAdvanceAt` in the FalukantUser model to track the last time a user advanced in nobility. - Updated the `FalukantService` to enforce a one-week cooldown between nobility advancements, throwing an error if the user attempts to advance too soon. - Ensured the `lastNobilityAdvanceAt` field is updated with the current date upon a successful nobility advancement.
30 lines
537 B
JavaScript
30 lines
537 B
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
await queryInterface.addColumn(
|
|
{
|
|
tableName: 'falukant_user',
|
|
schema: 'falukant_data'
|
|
},
|
|
'last_nobility_advance_at',
|
|
{
|
|
type: Sequelize.DATE,
|
|
allowNull: true
|
|
}
|
|
);
|
|
},
|
|
|
|
down: async (queryInterface, Sequelize) => {
|
|
await queryInterface.removeColumn(
|
|
{
|
|
tableName: 'falukant_user',
|
|
schema: 'falukant_data'
|
|
},
|
|
'last_nobility_advance_at'
|
|
);
|
|
}
|
|
};
|
|
|
|
|