-
Notifications
You must be signed in to change notification settings - Fork 9
Migration final deploy #132
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
Conversation
…t from legacy data
Performance tweaks for large account in prod
| @@ -0,0 +1,3 @@ | |||
| -- Add isFileSubmission flag to submissions to differentiate file vs URL entries | |||
| ALTER TABLE "submission" | |||
| ADD COLUMN IF NOT EXISTS "isFileSubmission" BOOLEAN NOT NULL DEFAULT false; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[performance]
Consider adding an index on the isFileSubmission column if it will be frequently queried or filtered on. This can improve query performance.
| @@index([committed]) // Index for filtering by committed status | ||
| @@index([submissionId]) // Index for filtering by submission | ||
| @@index([submissionId, id]) // Helps ORDER BY id after filtering by submission |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[performance]
The new index @@index([submissionId, id]) is added to help with ORDER BY id after filtering by submissionId. Ensure that this index is necessary and beneficial for your query patterns, as additional indexes can increase write overhead and storage usage.
| @@index([submissionId, id]) // Helps ORDER BY id after filtering by submission | ||
| @@index([resourceId]) // Index for filtering by resource (reviewer) | ||
| @@index([phaseId]) // Index for filtering by phase | ||
| @@index([phaseId, id]) // Helps ORDER BY id after filtering by phase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[performance]
The new index @@index([phaseId, id]) is added to help with ORDER BY id after filtering by phaseId. Verify that this index is required and will be utilized effectively, as it can lead to increased maintenance costs and storage requirements.
| appeal appeal? | ||
| @@index([reviewItemId]) // Index for joining with reviewItem table | ||
| @@index([reviewItemId, sortOrder, id]) // Helps ordered pagination on review item comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[performance]
The new index @@index([reviewItemId, sortOrder, id]) is intended to assist with ordered pagination on review item comments. Ensure that the query patterns justify this index, as it can add overhead to write operations and consume additional storage.
| fileSize Int? | ||
| viewCount Int? | ||
| systemFileName String? | ||
| isFileSubmission Boolean @default(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[design]
The addition of the isFileSubmission field with a default value of false should be reviewed to ensure it aligns with the existing data model and business logic. Consider potential impacts on existing queries and data integrity.
| }) | ||
| async createSubmission( | ||
| @Req() req: Request, | ||
| @UploadedFile() file: Express.Multer.File, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ security]
Ensure that the @UploadedFile() decorator is correctly configured to handle file uploads securely. Consider validating the file type and size to prevent potential security risks associated with handling binary data.
| ); | ||
| const authUser: JwtUser = req['user'] as JwtUser; | ||
| return this.service.createSubmission(authUser, body); | ||
| return this.service.createSubmission(authUser, body, file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[correctness]
The createSubmission method now includes a file parameter. Ensure that the createSubmission service method properly handles the file, including validation and storage, to avoid potential issues with file handling.
| ui: { | ||
| reviewUIUrl: | ||
| process.env.REVIEW_UI_URL ?? 'https://review-v6.topcoder-dev.com', | ||
| reviewUIUrl: process.env.REVIEW_UI_URL ?? 'https://review.topcoder-dev.com', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗ correctness]
The change updates the default URL from https://review-v6.topcoder-dev.com to https://review.topcoder-dev.com. Ensure that this change aligns with the intended environment and that the new URL is correctly configured and accessible. This could impact the application's ability to connect to the review UI if the URL is incorrect.
No description provided.