source-academy / stories-backend

Backend of Source Academy extension for Stories support.
0 stars 0 forks source link

Add course group mapping #97

Closed YaleChen299 closed 10 months ago

YaleChen299 commented 11 months ago

Adds the mapping between courses in the main backend to the groups in the stories backend.

YaleChen299 commented 11 months ago

I'm not too sure, what's the rationale of using the course ID as a primary key, especially since we already have an ID column? What would happen if a course wants to have multiple groups in the future?

If it's simply to enforce the uniqueness, I would argue it's better to create a unique index, and just drop/modify it later if we want to support the has-many relationship.

My main thought process is that this feature is just one for some default view just like the last_viewed_course in the main backend, so we just need one default one that ties to the course. That's why I think it is just a table that uses course as a key. I don't think we really need that many course to one group feature though. When we have more groups the group is just like a channel that you subscribed to. We just need to show all groups joined by a user and the user can switch group.

github-actions[bot] commented 11 months ago

Coverage Status

coverage: 50.642% (-1.6%) from 52.245% when pulling 65ce5a2a8a645fd8922823cc4c40bdf51eda553f on add_course_group into 0d3f7304c7cbd8b900e6c0e26363e76e233a0de9 on main.