diff --git a/migrations/20190515055223-org-description-and-project-text-length.js b/migrations/20190515055223-org-description-and-project-text-length.js new file mode 100644 index 0000000..f06d73d --- /dev/null +++ b/migrations/20190515055223-org-description-and-project-text-length.js @@ -0,0 +1,43 @@ +'use strict'; + +module.exports = { + up: async (queryInterface, Sequelize) => { + /* + Add altering commands here. + Return a promise to correctly handle asynchronicity. + + Example: + return queryInterface.createTable('users', { id: Sequelize.INTEGER }); + */ + return Promise.all([ + queryInterface.changeColumn('organizations', 'short_description', { + type: Sequelize.TEXT, + allowNull: false + }), + queryInterface.changeColumn('projects', 'description', { + type: Sequelize.TEXT, + allowNull: false + }) + ]); + }, + + down: async (queryInterface, Sequelize) => { + /* + Add reverting commands here. + Return a promise to correctly handle asynchronicity. + + Example: + return queryInterface.dropTable('users'); + */ + return Promise.all([ + queryInterface.changeColumn('organizations', 'short_description', { + type: Sequelize.STRING, + allowNull: false + }), + queryInterface.changeColumn('projects', 'description', { + type: Sequelize.STRING, + allowNull: false + }) + ]); + } +}; diff --git a/models/Organization.js b/models/Organization.js index 92a06b9..9038db3 100644 --- a/models/Organization.js +++ b/models/Organization.js @@ -15,7 +15,7 @@ module.exports = (sequelize, DataTypes) => { type: DataTypes.STRING, allowNull: true }, - short_description: { type: DataTypes.STRING, allowNull: false }, + short_description: { type: DataTypes.Text, allowNull: false }, total_received: { type: DataTypes.INTEGER, defaultValue: 0 diff --git a/models/Project.js b/models/Project.js index 034627b..38ea494 100644 --- a/models/Project.js +++ b/models/Project.js @@ -26,7 +26,7 @@ module.exports = (sequelize, DataTypes) => { type: DataTypes.STRING(1000), allowNull: false }, - description: DataTypes.STRING, + description: { type: DataTypes.Text, allowNull: false }, isComplete: { type: DataTypes.BOOLEAN, defaultValue: false