diff options
author | Pedro Ferreira | 2017-07-10 20:09:59 +0200 |
---|---|---|
committer | Pedro Ferreira | 2018-03-26 15:55:39 +0200 |
commit | 34df7ccce83bebec1db3b6995eb25cb6fe4fdbd4 (patch) | |
tree | 0b20a9c3f4135e9a74cff117793fef77a772f823 | |
parent | 40b385570291278f44806446f702ee61e1382805 (diff) |
Use TEXT instead of STRING for tokens
Signed-off-by: Pedro Ferreira <pedro.ferreira@cern.ch>
Diffstat (limited to '')
-rw-r--r-- | lib/migrations/20180326103000-use-text-in-tokens.js | 23 | ||||
-rw-r--r-- | lib/models/user.js | 4 |
2 files changed, 25 insertions, 2 deletions
diff --git a/lib/migrations/20180326103000-use-text-in-tokens.js b/lib/migrations/20180326103000-use-text-in-tokens.js new file mode 100644 index 00000000..f9507747 --- /dev/null +++ b/lib/migrations/20180326103000-use-text-in-tokens.js @@ -0,0 +1,23 @@ +'use strict' + +module.exports = { + up: function (queryInterface, Sequelize) { + return queryInterface.changeColumn('Users', 'accessToken', { + type: Sequelize.TEXT + }).then(function () { + return queryInterface.changeColumn('Users', 'refreshToken', { + type: Sequelize.TEXT + }) + }) + }, + + down: function (queryInterface, Sequelize) { + return queryInterface.changeColumn('Users', 'accessToken', { + type: Sequelize.STRING + }).then(function () { + return queryInterface.changeColumn('Users', 'refreshToken', { + type: Sequelize.STRING + }) + }) + } +} diff --git a/lib/models/user.js b/lib/models/user.js index f421fe43..ea249726 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -26,10 +26,10 @@ module.exports = function (sequelize, DataTypes) { type: DataTypes.TEXT }, accessToken: { - type: DataTypes.STRING + type: DataTypes.TEXT }, refreshToken: { - type: DataTypes.STRING + type: DataTypes.TEXT }, email: { type: Sequelize.TEXT, |