Skip to content

Commit 84ce3c5

Browse files
author
vikasrohit
authored
Merge pull request #310 from topcoder-platform/hotfix/adding_quantity_field_project_estimations
Hotfix/adding quantity field project estimations
2 parents 271f710 + 32ccec7 commit 84ce3c5

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--
2+
-- UPDATE EXISTING TABLES:
3+
-- project_estimations:
4+
-- added column `quantity`
5+
6+
--
7+
-- product_templates
8+
9+
-- Add new column
10+
ALTER TABLE project_estimations ADD COLUMN "quantity" int DEFAULT 1;

src/models/projectEstimation.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module.exports = function defineProjectHistory(sequelize, DataTypes) {
66
buildingBlockKey: { type: DataTypes.STRING, allowNull: false },
77
conditions: { type: DataTypes.STRING, allowNull: false },
88
price: { type: DataTypes.DOUBLE, allowNull: false },
9+
quantity: { type: DataTypes.INTEGER, allowNull: true },
910
minTime: { type: DataTypes.INTEGER, allowNull: false },
1011
maxTime: { type: DataTypes.INTEGER, allowNull: false },
1112
metadata: { type: DataTypes.JSON, allowNull: false, defaultValue: {} },

src/routes/projects/create.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ const createProjectValdiations = {
6060
estimation: Joi.array().items(Joi.object().keys({
6161
conditions: Joi.string().required(),
6262
price: Joi.number().required(),
63+
quantity: Joi.number().optional(),
6364
minTime: Joi.number().integer().required(),
6465
maxTime: Joi.number().integer().required(),
6566
buildingBlockKey: Joi.string().required(),

0 commit comments

Comments
 (0)