diff --git a/migrations/2021-06-30-role-search-request-make-job-description-longer.js b/migrations/2021-06-30-role-search-request-make-job-description-longer.js new file mode 100644 index 00000000..833bebb4 --- /dev/null +++ b/migrations/2021-06-30-role-search-request-make-job-description-longer.js @@ -0,0 +1,10 @@ +const config = require('config') + +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.changeColumn({ tableName: 'role_search_requests', schema: config.DB_SCHEMA_NAME}, 'job_description', {type: Sequelize.STRING(2000)}) + }, + down: async (queryInterface, Sequelize) => { + await queryInterface.changeColumn({ tableName: 'role_search_requests', schema: config.DB_SCHEMA_NAME}, 'job_description', {type: Sequelize.STRING(255)}) + }, +} \ No newline at end of file diff --git a/migrations/2021-07-01-role-insert-custom-role.js b/migrations/2021-07-01-role-insert-custom-role.js new file mode 100644 index 00000000..c6c79101 --- /dev/null +++ b/migrations/2021-07-01-role-insert-custom-role.js @@ -0,0 +1,23 @@ +const config = require('config') +const { v4: uuid } = require('uuid') + +module.exports = { + up: async (queryInterface, Sequelize) => { + await queryInterface.bulkInsert({ tableName: 'roles', schema: config.DB_SCHEMA_NAME }, [{ + id: uuid(), + name: 'Custom', + rates: [ + { + "global": 1200, + "off_shore": 1200, + "in_country": 1200, + } + ], + created_by: config.m2m.M2M_AUDIT_USER_ID, + created_at: new Date() + }], {}, { rates: { type: Sequelize.ARRAY({ type: Sequelize.JSONB() })}}) + }, + down: async (queryInterface) => { + await queryInterface.bulkDelete({ tableName: 'roles', schema: config.DB_SCHEMA_NAME }, { name: 'Custom' }) + } +} \ No newline at end of file diff --git a/src/services/TeamService.js b/src/services/TeamService.js index 36a30ab7..483c63e1 100644 --- a/src/services/TeamService.js +++ b/src/services/TeamService.js @@ -977,7 +977,7 @@ createRoleSearchRequest.schema = Joi.object() currentUser: Joi.object().required(), roleSearchRequest: Joi.object().keys({ roleId: Joi.string().uuid(), - jobDescription: Joi.string().max(255), + jobDescription: Joi.string().max(2000), skills: Joi.array().items(Joi.string().uuid().required()) }).required().min(1) }).required()