added new columns and migrated it to the database#62
added new columns and migrated it to the database#62agamv25 wants to merge 1 commit intothoth-tech:9.xfrom
Conversation
|
Hi Agam! |
Duy-Nguyen1104
left a comment
There was a problem hiding this comment.
I tested it and the corresponding attribute shows. But for the already populated data, all the attributes are showing null:
"creditpoint": null,
"prerequisite": null,
"corequisite": null,
Will we have to update all the units available on Ontrack if this is merged into production? If this is no problem, then I will approve the PR
I saw your code review and the default value for these rows I added for prerequisite and corequisite were null, as many units don't have any code values, so it makes more sense to populate them manually. If the front-end finds any value empty, it will show "null" on the front-end, so it shouldn't affect any functionality |
| expose :learning_outcomes, using: LearningOutcomeEntity, as: :ilos, unless: :summary_only | ||
| expose :tutorial_streams, using: TutorialStreamEntity, unless: :summary_only | ||
|
|
||
| # Expose staff before tutorials, so that their details are available |
There was a problem hiding this comment.
This comment should probably remain in the code
| optional :prerequisite, type: String | ||
| optional :corequisite, type: String |
There was a problem hiding this comment.
prerequisites and corequisites should probably be some sort of (array of) references to the existing unit definitions, instead of string
| change_column_default :units, :corequisite, from: nil, to: "Nil" | ||
| change_column_default :units, :prerequisite, from: nil, to: "Nil" |
There was a problem hiding this comment.
corequisite and prerequisite should be of NULL type if empty
Yes, I made the changes according to the schema design approach from the Courseflow documentation |
Assuming you're referring to this documentation: https://thoth-tech.netlify.app/products/courseflow/documentation/design/backend-functional-requirements/#requirements, there is mention of a The Also, as you are working on the courseflow feature, please update your base branch from |
|
@AgamSingh4756 This PR has not passed senior leader review, and hence, is not ready and won't count as a complete task. |
Description
Made changes in the database by migrating creditpoint, prerequisite and corequisite to the database to call it from the backend and use it in the front-end. Made changes to the units_api.rb, database_populator.rb, unit_entity.rb and schema.rb files
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Test A

First I used Postman to get the unit details and to see if the changes are visible in the output
Test B
In the front-end I used the create unit file to create a new unit and check if the default values are present.
Checklist:
If you have any questions, please contact @macite or @jakerenzella.