add cron service to obtain oauth token and store it to the DB

This commit is contained in:
Bilal Catic
2019-08-30 23:19:04 +02:00
parent 4bf6d5f55d
commit 333733099b
8 changed files with 175 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.createTable('accessTokens', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
},
token: Sequelize.TEXT,
validUntil: Sequelize.DATE,
createdAt: {
allowNull: false,
type: Sequelize.DATE
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE
}
});
},
down: (queryInterface, Sequelize) => {
return queryInterface.dropTable('accessTokens');
}
};