Add drop and pull cooldowns
This commit is contained in:
@@ -12,7 +12,7 @@ module.exports = {
|
||||
async down (queryInterface, Sequelize) {
|
||||
await queryInterface.changeColumn('Cards', 'userId', {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false
|
||||
defaultValue: 0
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
39
migrations/20220819073326-add-cooldown-fields-to-user.js
Normal file
39
migrations/20220819073326-add-cooldown-fields-to-user.js
Normal file
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
async up (queryInterface, Sequelize) {
|
||||
await queryInterface.addColumn('Users', 'nextDrop', {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: true,
|
||||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP')
|
||||
});
|
||||
await queryInterface.addColumn('Users', 'nextPull', {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: true,
|
||||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP')
|
||||
});
|
||||
await queryInterface.addColumn('Users', 'nextDaily', {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: true,
|
||||
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP')
|
||||
});
|
||||
await queryInterface.addColumn('Bots', 'pullTimeout', {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 300000 // 5 minutes
|
||||
});
|
||||
await queryInterface.addColumn('Bots', 'dropTimeout', {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 900000 // 15 minutes
|
||||
});
|
||||
},
|
||||
|
||||
async down (queryInterface, Sequelize) {
|
||||
await queryInterface.removeColumn('Users', 'nextDrop');
|
||||
await queryInterface.removeColumn('Users', 'nextPull');
|
||||
await queryInterface.removeColumn('Users', 'nextDaily');
|
||||
await queryInterface.removeColumn('Bots', 'pullTimeout');
|
||||
await queryInterface.removeColumn('Bots', 'dropTimeout');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user