Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions migrations/2021-01-13-make-some-job-fields-longer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Make some Job fields longer
* title: 64 -> 128
* description: change type to TEXT (unlimited length)
*/

module.exports = {
up: queryInterface => {
return Promise.all([
queryInterface.sequelize.query(`ALTER TABLE bookings.jobs ALTER COLUMN title TYPE VARCHAR(128)`),
queryInterface.sequelize.query(`ALTER TABLE bookings.jobs ALTER COLUMN description TYPE TEXT`)
])
},
down: queryInterface => {
return Promise.all([
queryInterface.sequelize.query(`ALTER TABLE bookings.jobs ALTER COLUMN title TYPE VARCHAR(64)`),
queryInterface.sequelize.query(`ALTER TABLE bookings.jobs ALTER COLUMN description TYPE VARCHAR(255)`)
])
}
}
2 changes: 1 addition & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Joi.rateType = () => Joi.string().valid('hourly', 'daily', 'weekly', 'monthly')
Joi.jobStatus = () => Joi.string().valid('sourcing', 'in-review', 'assigned', 'closed', 'cancelled')
Joi.workload = () => Joi.string().valid('full-time', 'fractional')
Joi.jobCandidateStatus = () => Joi.string().valid('open', 'selected', 'shortlist', 'rejected', 'cancelled')
Joi.title = () => Joi.string().max(64)
Joi.title = () => Joi.string().max(128)

function buildServices (dir) {
const files = fs.readdirSync(dir)
Expand Down
14 changes: 7 additions & 7 deletions src/models/Job.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ module.exports = (sequelize) => {
},
externalId: {
field: 'external_id',
type: Sequelize.STRING
type: Sequelize.STRING(255)
},
description: {
type: Sequelize.STRING
type: Sequelize.TEXT, // technically unlimited length
},
title: {
type: Sequelize.STRING,
type: Sequelize.STRING(128),
allowNull: false
},
startDate: {
Expand All @@ -90,22 +90,22 @@ module.exports = (sequelize) => {
},
resourceType: {
field: 'resource_type',
type: Sequelize.STRING
type: Sequelize.STRING(255)
},
rateType: {
field: 'rate_type',
type: Sequelize.STRING
type: Sequelize.STRING(255)
},
workload: {
field: 'workload',
type: Sequelize.STRING
type: Sequelize.STRING(45)
},
skills: {
type: Sequelize.JSONB,
allowNull: false
},
status: {
type: Sequelize.STRING,
type: Sequelize.STRING(255),
allowNull: false
},
createdAt: {
Expand Down
6 changes: 3 additions & 3 deletions src/models/JobCandidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ module.exports = (sequelize) => {
allowNull: false
},
status: {
type: Sequelize.STRING,
type: Sequelize.STRING(255),
allowNull: false
},
externalId: {
field: 'external_id',
type: Sequelize.STRING
type: Sequelize.STRING(255)
},
resume: {
type: Sequelize.STRING
type: Sequelize.STRING(2048)
},
createdAt: {
field: 'created_at',
Expand Down
4 changes: 2 additions & 2 deletions src/models/ResourceBooking.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = (sequelize) => {
type: Sequelize.UUID
},
status: {
type: Sequelize.STRING,
type: Sequelize.STRING(255),
allowNull: false
},
startDate: {
Expand All @@ -77,7 +77,7 @@ module.exports = (sequelize) => {
},
rateType: {
field: 'rate_type',
type: Sequelize.STRING,
type: Sequelize.STRING(255),
allowNull: false
},
createdAt: {
Expand Down