Skip to content

Commit

Permalink
feat: add description field to projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ec2sw committed May 9, 2022
1 parent 7f9fc14 commit e3b971d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

export default {
async up(queryInterface, Sequelize) {
queryInterface.addColumn('projects', 'description', {
type: Sequelize.STRING,
allowNull: true,
});
},

async down(queryInterface) {
queryInterface.removeColumn('projects', 'description');
},
};
5 changes: 5 additions & 0 deletions src/database/migrations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import CreateMetaTable from './20220119211024-create-meta-table';
import CreateGoveranceTable from './20220315134151-create-governance-table';
import AddCommentColumnToDataModelTables from './20220428144558-add-comment-column-to-all-datamodels';
import AddSerialNumberFields from './20220504180739-add-serial-number-fields';
import AddDescriptionFieldToProjects from './20220509125335-add-description-field-to-projects';

export const migrations = [
{
Expand Down Expand Up @@ -114,4 +115,8 @@ export const migrations = [
migration: AddSerialNumberFields,
name: '20220504180739-add-serial-number-fields.js',
},
{
migration: AddDescriptionFieldToProjects,
name: '20220509125335-add-description-field-to-projects',
},
];
4 changes: 4 additions & 0 deletions src/models/projects/projects.modeltypes.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ module.exports = {
timeStaged: {
type: Sequelize.STRING,
},
description: {
type: Sequelize.STRING,
allowNull: true,
},
createdAt: {
type: Sequelize.DATE,
defaultValue: Sequelize.NOW,
Expand Down
1 change: 1 addition & 0 deletions src/validations/projects.validations.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const baseSchema = {
.custom(pickListValidation('validationBody'))
.optional(),
validationDate: Joi.date().optional(),
description: Joi.string().optional(),

/* Child Tables */
labels: Joi.array().items(labelSchema).min(1).optional(),
Expand Down

0 comments on commit e3b971d

Please sign in to comment.