Skip to content

Commit

Permalink
Merge pull request #6380 from NMDSdevopsServiceAdm/featureBranch/trai…
Browse files Browse the repository at this point in the history
…ning-certificates

Feature branch/training certificates
  • Loading branch information
duncanc19 authored Nov 5, 2024
2 parents 28b7502 + ca816b3 commit 2ca0f56
Show file tree
Hide file tree
Showing 66 changed files with 9,122 additions and 2,484 deletions.
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',
});
},
};
Loading

0 comments on commit 2ca0f56

Please sign in to comment.