-
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.
Merge pull request #6380 from NMDSdevopsServiceAdm/featureBranch/trai…
…ning-certificates Feature branch/training certificates
- Loading branch information
Showing
66 changed files
with
9,122 additions
and
2,484 deletions.
There are no files selected for viewing
71 changes: 71 additions & 0 deletions
71
backend/migrations/20240912113822-createTableForTrainingCertificates.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,71 @@ | ||
'use strict'; | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
module.exports = { | ||
async up(queryInterface, Sequelize) { | ||
return queryInterface.createTable( | ||
'TrainingCertificates', | ||
{ | ||
ID: { | ||
type: Sequelize.INTEGER, | ||
primaryKey: true, | ||
autoIncrement: true, | ||
}, | ||
UID: { | ||
type: Sequelize.DataTypes.UUID, | ||
defaultValue: Sequelize.literal('uuid_generate_v4()'), | ||
allowNull: false, | ||
unique: true, | ||
}, | ||
WorkerTrainingFK: { | ||
type: Sequelize.DataTypes.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: { | ||
tableName: 'WorkerTraining', | ||
schema: 'cqc', | ||
}, | ||
key: 'ID', | ||
}, | ||
}, | ||
WorkerFK: { | ||
type: Sequelize.DataTypes.INTEGER, | ||
allowNull: false, | ||
references: { | ||
model: { | ||
tableName: 'Worker', | ||
schema: 'cqc', | ||
}, | ||
key: 'ID', | ||
}, | ||
}, | ||
FileName: { | ||
type: Sequelize.DataTypes.TEXT, | ||
allowNull: false, | ||
}, | ||
UploadDate: { | ||
type: Sequelize.DataTypes.DATE, | ||
allowNull: true, | ||
}, | ||
Key: { | ||
type: Sequelize.DataTypes.TEXT, | ||
allowNull: false, | ||
}, | ||
}, | ||
{ schema: 'cqc' }, | ||
); | ||
}, | ||
|
||
async down(queryInterface) { | ||
/** | ||
* Add reverting commands here. | ||
* | ||
* Example: | ||
* await queryInterface.dropTable('users'); | ||
*/ | ||
return queryInterface.dropTable({ | ||
tableName: 'TrainingCertificates', | ||
schema: 'cqc', | ||
}); | ||
}, | ||
}; |
Oops, something went wrong.