-
Notifications
You must be signed in to change notification settings - Fork 40
Create migration script for reporting #1316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict'; | ||
|
||
/** @type {import('sequelize-cli').Migration} */ | ||
module.exports = { | ||
async up(queryInterface, Sequelize) { | ||
const transaction = await queryInterface.sequelize.transaction(); | ||
try { | ||
await queryInterface.sequelize.query( | ||
`ALTER TYPE enum_files_source ADD VALUE 'Report';`, | ||
{ transaction } | ||
); | ||
await transaction.commit(); | ||
} catch (error) { | ||
await transaction.rollback(); | ||
throw error; | ||
} | ||
}, | ||
|
||
async down(queryInterface, Sequelize) { | ||
// The enum value won't cause any issues if it is not removed | ||
samuel-coutinho marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ export const uploadFile = async ( | |
file: UploadedFile, | ||
user_id: number, | ||
project_framework_id: number, | ||
source: "Assessment tracker group" | "Compliance tracker group", | ||
source: "Assessment tracker group" | "Compliance tracker group" | "Report", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainLGTM! Type definition correctly updated for 'Report' source The type definition for the Consider whether any downstream consumers of this function need to be updated to handle the new source type. If the source type affects file handling behavior elsewhere in the application, those areas might need updates as well. 🏁 Script executed: #!/bin/bash
# Check for any other references to the source field that might need updating
rg -A 1 -B 1 "source: (\"Assessment tracker group\" \| \"Compliance tracker group\")" --type ts --glob "!Servers/utils/fileUpload.utils.ts" --glob "!Servers/models/file.model.ts" Length of output: 176 🏁 Script executed: #!/bin/bash
# Search for any mentions of the source literal values in TypeScript files
rg "Assessment tracker group" --type ts
rg "Compliance tracker group" --type ts
# Inspect the 'source' property definition in the file model to ensure it's updated
rg "source" -A2 -B2 Servers/models/file.model.ts Length of output: 2570 Ensure ‘Report’ source is handled downstream The type definition and model enum have been correctly expanded to include
Please add or update any controllers, services, or UI components that should upload files with the |
||
transaction: Transaction | null = null | ||
) => { | ||
const project = await sequelize.query( | ||
|
Uh oh!
There was an error while loading. Please reload this page.