-
Notifications
You must be signed in to change notification settings - Fork 121
added new columns and migrated it to the database #62
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
base: 9.x
Are you sure you want to change the base?
Conversation
|
Hi Agam! |
Duy-Nguyen1104
left a comment
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.
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 |
b0ink
left a comment
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.
Hi @agamv25
Just a few notes regarding your prerequisite and corequisite columns that may need further consideration on how they'll be implemented.
Are your changes based off any documentation that covers the schema design approach?
| 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment should probably remain in the code
| optional :prerequisite, type: String | ||
| optional :corequisite, type: String |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.