tutorbookapp / tutorbook

Web app that helps schools and nonprofits connect students with expert mentors and volunteer tutors.
https://tutorbook.org
Other
58 stars 13 forks source link

feat: use `subjects` PostgreSQL table #268

Closed nicholaschiang closed 2 years ago

nicholaschiang commented 2 years ago

Fixes TB-153

linear[bot] commented 2 years ago
TB-153 Create PostgreSQL subjects table

Instead of using Algolia, I should simply create a PostgreSQL `subjects` table that includes all of our available subjects. I'll then be able to use PostgreSQL relations to ensure that meetings, profiles, and orgs all reference valid and up-to-date (currently supported) subjects: * `relation_meeting_subjects` - Relates a `meeting` to a `subject` (many-to-many). * `relation_org_subjects` - Relates an `org` to a `subject` (many-to-many). * `relation_user_subjects` - Relates a `user` to a `subject` (many-to-many). I'll then have to aggregate those fields into `subjects` arrays in their respective views. I can also add fancy relational constraints so that, for example, a `meeting` can't have a `subject` that isn't supported by that meeting's `org`.

vercel[bot] commented 2 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tutorbook/tutorbook/68eoomwu3L5iSfyitcc5z3y1LgDG
✅ Preview: https://tutorbook-git-subjects-tutorbook.vercel.app

codecov[bot] commented 2 years ago

Codecov Report

Merging #268 (f12f5bb) into develop (a2040ec) will decrease coverage by 0.35%. The diff coverage is 64.91%.

:exclamation: Current head f12f5bb differs from pull request most recent head 6d9691d. Consider uploading reports for the commit 6d9691d to get more accurate results Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #268      +/-   ##
===========================================
- Coverage    69.27%   68.92%   -0.36%     
===========================================
  Files          221      224       +3     
  Lines         4645     4704      +59     
  Branches      1263     1272       +9     
===========================================
+ Hits          3218     3242      +24     
- Misses        1427     1462      +35     
Impacted Files Coverage Δ
components/calendar/dialog/create-page.tsx 0.00% <0.00%> (ø)
components/calendar/dialog/edit-page.tsx 0.00% <0.00%> (ø)
components/calendar/filters-sheet.tsx 57.14% <0.00%> (ø)
components/profile/index.tsx 69.23% <0.00%> (ø)
components/users/filters-sheet.tsx 50.00% <0.00%> (ø)
lib/intl/utils.ts 89.47% <ø> (ø)
lib/api/db/org.ts 57.77% <10.00%> (-13.66%) :arrow_down:
lib/api/db/meeting.ts 47.05% <46.15%> (-0.40%) :arrow_down:
pages/api/subjects.ts 73.33% <73.33%> (ø)
lib/api/verify/subjects-can-be-tutored.ts 80.00% <75.00%> (-3.34%) :arrow_down:
... and 28 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5ab1932...6d9691d. Read the comment docs.

cypress[bot] commented 2 years ago



Test summary

9 17 0 8Flakiness 0


Run details

Project tutorbook
Status Failed
Commit 223f3d4197
Started Oct 30, 2021 8:26 PM
Ended Oct 30, 2021 8:35 PM
Duration 08:29 💡
OS Linux Ubuntu - 20.04
Browser Chrome 94

View run in Cypress Dashboard ➡️


Failures

org/users/id/index.spec.ts Failed
1 User display page > collects profiles before booking meetings
2 User display page > lets parents book meetings for their kids
3 User display page > signs users up before booking meetings
org/search.spec.ts Failed
1 Search page > restricts access to school data
2 Search page > partitions search results by org
3 Search page > filters users by subjects, langs, and name
profile.spec.ts Failed
1 Profile page > redirects to login page when logged out
login.spec.ts Failed
1 Login page > navigates to overview on successful login
2 Login page > navigates to specified redirect destination
org/signup.spec.ts Failed
1 Signup page > validates email addresses
This comment includes only the first 10 test failures. See all 17 failures in the Cypress Dashboard.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

nicholaschiang commented 2 years ago

📝 Changed routes:

Commit 6d9691def4340a52e429b5a1e9e76b9cc3805beb (https://tutorbook-5kc9kjyud-tutorbook.vercel.app).