-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
78 changed files
with
12,152 additions
and
32,242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
backend/migrations/20240827102746-addLevel2CareCertificate.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
'use strict'; | ||
|
||
const table = { tableName: 'Worker', schema: 'cqc' }; | ||
|
||
module.exports = { | ||
up: (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction((transaction) => { | ||
return Promise.all([ | ||
queryInterface.addColumn( | ||
table, | ||
'Level2CareCertificateValue', | ||
{ | ||
type: Sequelize.DataTypes.TEXT, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.addColumn( | ||
table, | ||
'Level2CareCertificateYear', | ||
{ | ||
type: Sequelize.DataTypes.INTEGER, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.addColumn( | ||
table, | ||
'Level2CareCertificateSavedAt', | ||
{ | ||
type: Sequelize.DataTypes.DATE, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.addColumn( | ||
table, | ||
'Level2CareCertificateChangedAt', | ||
{ | ||
type: Sequelize.DataTypes.DATE, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.addColumn( | ||
table, | ||
'Level2CareCertificateSavedBy', | ||
{ | ||
type: Sequelize.DataTypes.TEXT, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
queryInterface.addColumn( | ||
table, | ||
'Level2CareCertificateChangedBy', | ||
{ | ||
type: Sequelize.DataTypes.TEXT, | ||
allowNull: true, | ||
}, | ||
{ transaction }, | ||
), | ||
]); | ||
}); | ||
}, | ||
down: (queryInterface, Sequelize) => { | ||
return queryInterface.sequelize.transaction((transaction) => { | ||
return Promise.all([ | ||
queryInterface.removeColumn(table, 'Level2CareCertificateValue', { transaction }), | ||
queryInterface.removeColumn(table, 'Level2CareCertificateYear', { transaction }), | ||
queryInterface.removeColumn(table, 'Level2CareCertificateSavedAt', { transaction }), | ||
queryInterface.removeColumn(table, 'Level2CareCertificateChangedAt', { transaction }), | ||
queryInterface.removeColumn(table, 'Level2CareCertificateSavedBy', { transaction }), | ||
queryInterface.removeColumn(table, 'Level2CareCertificateChangedBy', { transaction }), | ||
]); | ||
}); | ||
}, | ||
}; |
Oops, something went wrong.