From ac2060b1661fa043a7ed79cb29dd17ece577e066 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 6 Dec 2020 16:51:25 -0800 Subject: [PATCH] fix: Migrate attachment columns to incease available length (#1704) closes #1703 --- .../20201206210619-update-attachment-cols.js | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 server/migrations/20201206210619-update-attachment-cols.js diff --git a/server/migrations/20201206210619-update-attachment-cols.js b/server/migrations/20201206210619-update-attachment-cols.js new file mode 100644 index 000000000..1cacacdf9 --- /dev/null +++ b/server/migrations/20201206210619-update-attachment-cols.js @@ -0,0 +1,29 @@ +'use strict'; + +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.changeColumn( + "attachments", + "key", + { type: Sequelize.STRING(4096), allowNull: false, } + ); + await queryInterface.changeColumn( + "attachments", + "url", + { type: Sequelize.STRING(4096), allowNull: false, } + ); + }, + + down: async (queryInterface, Sequelize) => { + await queryInterface.changeColumn( + "attachments", + "key", + { type: Sequelize.STRING(255), allowNull: false, } + ); + await queryInterface.changeColumn( + "attachments", + "url", + { type: Sequelize.STRING(255), allowNull: false, } + ); + } +};