Track recently active and signin times (#663)
* Track recently active and signin times * Trust proxy headers in production
This commit is contained in:
26
server/migrations/20180604182823-user-tracking.js
Normal file
26
server/migrations/20180604182823-user-tracking.js
Normal file
@@ -0,0 +1,26 @@
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.addColumn('users', 'lastActiveAt', {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: true
|
||||
});
|
||||
await queryInterface.addColumn('users', 'lastActiveIp', {
|
||||
type: Sequelize.STRING,
|
||||
allowNull: true
|
||||
});
|
||||
await queryInterface.addColumn('users', 'lastSignedInAt', {
|
||||
type: Sequelize.DATE,
|
||||
allowNull: true
|
||||
});
|
||||
await queryInterface.addColumn('users', 'lastSignedInIp', {
|
||||
type: Sequelize.STRING,
|
||||
allowNull: true
|
||||
});
|
||||
},
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.removeColumn('users', 'lastActiveAt');
|
||||
await queryInterface.removeColumn('users', 'lastActiveIp');
|
||||
await queryInterface.removeColumn('users', 'lastSignedInAt');
|
||||
await queryInterface.removeColumn('users', 'lastSignedInIp');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user