From 34df7ccce83bebec1db3b6995eb25cb6fe4fdbd4 Mon Sep 17 00:00:00 2001 From: Pedro Ferreira Date: Mon, 10 Jul 2017 20:09:59 +0200 Subject: Use TEXT instead of STRING for tokens Signed-off-by: Pedro Ferreira --- .../20180326103000-use-text-in-tokens.js | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 lib/migrations/20180326103000-use-text-in-tokens.js (limited to 'lib/migrations/20180326103000-use-text-in-tokens.js') 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 + }) + }) + } +} -- cgit v1.2.3