nsc-events-fullstack_30_130_erd-schema-refactoring#142
Conversation
beimnettes
left a comment
There was a problem hiding this comment.
HY @NahomAlemu, I pulled the branch locally and reviewed the backend changes. The new structure with the user, tag, and media entities makes the schema much cleaner and easier to follow, and it lines up well with the updated ERD. The database reset note is clear. Since this is an ongoing PR, I’ll continue reviewing as updates come in.
E2E Test Results
|
|
@NahomAlemu
2. Event data not visible on frontend. Receiving 500 error when attempting to fetch events from events api.
|
Hey Troy, thanks for reviewing this PR. Yes, the test data is coming from Playwright. We do have a teardown step in place; I’ll double-check whether it’s being triggered correctly. Either way, the data is isolated to the test environment and isn’t harmful. This is a known frontend issue. Since this PR focuses on the database schema redesign, the frontend hasn’t been fully wired yet. I’ve created tracking issues for the UI work, and we’ll address those once this PR is merged. UI inconsistencies in this branch are expected. Tracking issue example: |
|
I think I see what’s happening here, but the current approach introduces new issues rather than resolving the underlying one. The test were failing earlier because you had attempt to mask them rather than address the entire schema/test while adjusting the ERD. The recent commits I pushed:
were to fix the broken backend connection that was identified earlier today and align the test suite with the updated schema. As a result of the changes, both I'm going to dig further into the GitHub Actions setup to see what adjustments are needed to support the repository's current state and ensure the pipelines reflect the updated schema and test expectations. |
E2E Test Results
|
The issues related to the E2E tests were resolved in a separate PR, which was expected since I merged the main branch into this PR branch. The E2E tests were still referencing the old schema, which is why they were failing. This PR addresses that issue and additional related fixes: I’ve also discussed the UI issues with Troy. This PR should be good to merge alongside the upcoming PR that fixes the GitHub Actions failure, assuming there are no additional concerns. |
TVW96
left a comment
There was a problem hiding this comment.
I will approve this PR for schema adjustments. However, additional PRs will be required to rectify any misconfigurations after merging with your testing branch.
IsaacJrTypes
left a comment
There was a problem hiding this comment.
Great work on the ERD redesign and tests! Thanks for creating and reporting UI bug issues so we can track and revisit these issues in later PRs. Its awesome to see you focused on test driven development since its an essential practice when writing quality code.
My intention with this task was only to produce the ERD, but you definitely went ham with this PR. We will use the learning to help guide the migration to Supabase.
I am approving so we can move forward since the issues are documented.



Summary & Changes 📃
Resolves: #130, #134, #135, #136, #137, #138, #139, #140, #141
Summary: Complete database schema redesign for production readiness with proper TypeORM
relations, normalized entities, and robust media management.
normalized many-to-many relationships, cascading deletes, and no orphaned S3 files.
before running. Please Run this query in pgAdmin:
Changes:
Phase 1: Define Foreign Key Relationships (Issue: Define Foreign Key Relationships in Entities #137)
Phase 2: Remove attendees Property from Activity (Issue: Remove attendees Property from Activity Entity #135)
Phase 3: Remove Redundant User Fields from EventRegistration (Issue: Remove Redundant User Fields from EventRegistration Entity #136)
Phase 4: Fix Foreign Key Types (Issue: Fix Foreign Key Types in event_registrations #134)
Phase 5: Normalize eventTags to Separate Entity (Issue: Normalize eventTags to Separate Entity #138)
Phase 6: Create Media Entity (NEW)
Phase 7: Robust S3 Cleanup Mechanism (NEW)
🛠️ Breaking Changes
📝 New Endpoints
Visual Aids 🔎
Updated ERD
https://dbdiagram.io/d/NSC-Events-ERD-696e9c7ad6e030a02480f84a
Expand (current ERD) ⬇️
How to Test 🧪
- Step 1: Drop all existing database tables (DROP SCHEMA public CASCADE; CREATE SCHEMA
public;)
- Step 2: Run npm run start:dev - TypeORM will create new schema
- Step 3: Test CRUD operations on /events, /tags, /media endpoints
- Step 4: Verify tag filtering works: GET /events?tags=club,study
- Step 5: Test cover image upload and replacement
- All endpoints work with new schema
- Tag filtering uses JOIN instead of regex
- Cover image replacement deletes old file from S3
- Activity deletion cleans up associated media
Checklist ✅
Resolves #issue-number).