Skip to content

Commit da26f77

Browse files
Merge pull request #111 from topcoder-platform/dev
Dry Release 0.2.2
2 parents 0c11b79 + 2b6ccdb commit da26f77

File tree

5 files changed

+33
-13
lines changed

5 files changed

+33
-13
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Make some Job fields longer
3+
* title: 64 -> 128
4+
* description: change type to TEXT (unlimited length)
5+
*/
6+
7+
module.exports = {
8+
up: queryInterface => {
9+
return Promise.all([
10+
queryInterface.sequelize.query(`ALTER TABLE bookings.jobs ALTER COLUMN title TYPE VARCHAR(128)`),
11+
queryInterface.sequelize.query(`ALTER TABLE bookings.jobs ALTER COLUMN description TYPE TEXT`)
12+
])
13+
},
14+
down: queryInterface => {
15+
return Promise.all([
16+
queryInterface.sequelize.query(`ALTER TABLE bookings.jobs ALTER COLUMN title TYPE VARCHAR(64)`),
17+
queryInterface.sequelize.query(`ALTER TABLE bookings.jobs ALTER COLUMN description TYPE VARCHAR(255)`)
18+
])
19+
}
20+
}

src/bootstrap.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Joi.rateType = () => Joi.string().valid('hourly', 'daily', 'weekly', 'monthly')
99
Joi.jobStatus = () => Joi.string().valid('sourcing', 'in-review', 'assigned', 'closed', 'cancelled')
1010
Joi.workload = () => Joi.string().valid('full-time', 'fractional')
1111
Joi.jobCandidateStatus = () => Joi.string().valid('open', 'selected', 'shortlist', 'rejected', 'cancelled')
12-
Joi.title = () => Joi.string().max(64)
12+
Joi.title = () => Joi.string().max(128)
1313

1414
function buildServices (dir) {
1515
const files = fs.readdirSync(dir)

src/models/Job.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ module.exports = (sequelize) => {
6666
},
6767
externalId: {
6868
field: 'external_id',
69-
type: Sequelize.STRING
69+
type: Sequelize.STRING(255)
7070
},
7171
description: {
72-
type: Sequelize.STRING
72+
type: Sequelize.TEXT, // technically unlimited length
7373
},
7474
title: {
75-
type: Sequelize.STRING,
75+
type: Sequelize.STRING(128),
7676
allowNull: false
7777
},
7878
startDate: {
@@ -90,22 +90,22 @@ module.exports = (sequelize) => {
9090
},
9191
resourceType: {
9292
field: 'resource_type',
93-
type: Sequelize.STRING
93+
type: Sequelize.STRING(255)
9494
},
9595
rateType: {
9696
field: 'rate_type',
97-
type: Sequelize.STRING
97+
type: Sequelize.STRING(255)
9898
},
9999
workload: {
100100
field: 'workload',
101-
type: Sequelize.STRING
101+
type: Sequelize.STRING(45)
102102
},
103103
skills: {
104104
type: Sequelize.JSONB,
105105
allowNull: false
106106
},
107107
status: {
108-
type: Sequelize.STRING,
108+
type: Sequelize.STRING(255),
109109
allowNull: false
110110
},
111111
createdAt: {

src/models/JobCandidate.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ module.exports = (sequelize) => {
5353
allowNull: false
5454
},
5555
status: {
56-
type: Sequelize.STRING,
56+
type: Sequelize.STRING(255),
5757
allowNull: false
5858
},
5959
externalId: {
6060
field: 'external_id',
61-
type: Sequelize.STRING
61+
type: Sequelize.STRING(255)
6262
},
6363
resume: {
64-
type: Sequelize.STRING
64+
type: Sequelize.STRING(2048)
6565
},
6666
createdAt: {
6767
field: 'created_at',

src/models/ResourceBooking.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module.exports = (sequelize) => {
5656
type: Sequelize.UUID
5757
},
5858
status: {
59-
type: Sequelize.STRING,
59+
type: Sequelize.STRING(255),
6060
allowNull: false
6161
},
6262
startDate: {
@@ -77,7 +77,7 @@ module.exports = (sequelize) => {
7777
},
7878
rateType: {
7979
field: 'rate_type',
80-
type: Sequelize.STRING,
80+
type: Sequelize.STRING(255),
8181
allowNull: false
8282
},
8383
createdAt: {

0 commit comments

Comments
 (0)