Skip to content

Database mvc refactoring - #1604

Merged
david-yz-liu merged 16 commits into
Courseography:masterfrom
akarki2005:database-mvc-refactoring
Sep 16, 2025
Merged

Database mvc refactoring#1604
david-yz-liu merged 16 commits into
Courseography:masterfrom
akarki2005:database-mvc-refactoring

Conversation

@akarki2005

@akarki2005 akarki2005 commented Sep 13, 2025

Copy link
Copy Markdown
Contributor

Proposed Changes

This change further advances Courseography's shift to an MVC architecture by refactoring functions in the Database folder pertaining to course querying and insertion into well-defined model and controller files.

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality) X
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • [N/A] I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • [N/A] I have updated the project documentation, if applicable.
    • This is required for new features.
  • [N/A] If this is my first contribution, I have added myself to the list of contributors.
  • I have updated the project Changelog (this is required for all changes).

After opening your pull request:

  • I have verified that the CircleCI checks have passed.
  • I have requested a review from a project maintainer.

@akarki2005
akarki2005 marked this pull request as ready for review September 13, 2025 04:00
@coveralls

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build d3596bda-9058-481b-b883-c434b7c1601b

Details

  • 31 of 76 (40.79%) changed or added relevant lines in 4 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 54.732%

Changes Missing Coverage Covered Lines Changed/Added Lines %
app/Models/Post.hs 11 16 68.75%
app/Models/Course.hs 16 35 45.71%
app/Models/Meeting.hs 3 24 12.5%
Files with Coverage Reduction New Missed Lines %
app/Models/Course.hs 2 62.12%
Totals Coverage Status
Change from base Build bfec1df0-12cd-4adb-a40a-5f0514531d1c: 0.1%
Covered Lines: 2181
Relevant Lines: 3919

💛 - Coveralls

@david-yz-liu david-yz-liu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akarki2005 this is great. I realized that you and @matt-dahlgren have used slightly different names for the controller (see #1603).

Overall I think "Program" is better than "Post" for the codebase, so please do a bit more refactoring to switch from "Post" to "Program" in both the files and function/variable names. But, you can leave the database table and route names the same, as those are a bit more work to change.

@akarki2005

akarki2005 commented Sep 15, 2025

Copy link
Copy Markdown
Contributor Author

Hi @david-yz-liu, I have made the requested changes. :)

I noticed that you pointed out that changing the database table names would be complex, I assume due to the database migration necessitated by a schema change. I was wondering if this was something I could tackle in a future PR, as I am currently enrolled in CSC343 and would love to get some practical experience with schema evolution!

@david-yz-liu david-yz-liu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, @akarki2005!

@david-yz-liu
david-yz-liu merged commit b22d9df into Courseography:master Sep 16, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants