User: Add experience / levels
Each drop and claim hands out 10 and 5 xp respectively. The profile then renders the users current level based on the formula 0.5 * sqrt(exp)
This commit is contained in:
21
migrations/20220911230203-add-user-experience.js
Normal file
21
migrations/20220911230203-add-user-experience.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
async up (queryInterface, Sequelize) {
|
||||
/**
|
||||
* Add field experience to table users
|
||||
*/
|
||||
await queryInterface.addColumn('Users', 'experience', {
|
||||
type: Sequelize.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 0
|
||||
});
|
||||
},
|
||||
|
||||
async down (queryInterface, Sequelize) {
|
||||
/**
|
||||
* Remove field experience from table users
|
||||
*/
|
||||
await queryInterface.removeColumn('Users', 'experience');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user