Skip to content

baseline migration added - #647

Merged
Harxhit merged 4 commits into
Dev-Card:mainfrom
traitor09:db-fix
Jul 10, 2026
Merged

baseline migration added#647
Harxhit merged 4 commits into
Dev-Card:mainfrom
traitor09:db-fix

Conversation

@traitor09

@traitor09 traitor09 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #646


Type of Change

  • Bug fix
  • New feature
  • UI / Design change
  • Refactor (no functional change)
  • Tests only
  • Documentation
  • Infrastructure / DevOps
  • Security

What Changed

  • Removed the broken partial migration file .
    The baseline migration can be applied cleanly on a fresh database.
  • Removed incremental schema evolution (ALTER TABLE, DROP COLUMN, DROP INDEX)
    Incorporated all changes directly into CREATE TABLE definitions to eliminate migration dependencies.
  • Rebuilt the migration using schema
    Contains the final set of tables, enums, indexes, unique constraints, and foreign key relationships without redundant or obsolete objects.

How to Test

  1. Clone the repository on a fresh environment.
  2. Configure the required .env variables
  3. Install dependencies and and start the PostgreSQL database.
  4. Run database migrations npm run db:migrate
  5. Seed sample data npm run db:seed
  6. Start the backend npm run dev:backend

Checklist

  • My code follows the project's coding style (npm run lint passes).
  • TypeScript compiles without errors (npm run typecheck --workspaces --if-present).
  • I have added or updated tests for the changes I made.
  • All tests pass locally (npm run test --workspaces --if-present).
  • I have updated documentation where necessary.
  • No new console.log or debug statements left in the code.
  • Breaking changes are documented in this PR description.

Screenshots

Working changes..

db-fix-check

Additional Context

This PR replaces the previous migration history with a consolidated baseline migration intended for fresh database setups. Existing databases that have already applied the previous migrations should retain their migration history and should not reapply the new baseline migration.

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@divyanshipathak-swe is attempting to deploy a commit to the Prashantkumar Khatri's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added backend gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking. labels Jun 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @traitor09,

Thanks for opening this pull request.

This PR has been automatically classified based on the files modified.

Applied Labels

  • gssoc:approved
  • backend

Primary Review Area

  • backend

Reviewer

@Harxhit has been identified as the primary reviewer for this pull request.

If you have any questions regarding the affected area or implementation details, feel free to reach out to the assigned reviewer.

Thank you for your contribution!

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

CI — Checks Failed

Backend — FAIL

Check Result
Lint FAIL
Test PASS
Typecheck PASS

Mobile — SKIP

Check Result
Lint -
Test -

Web — SKIP

Check Result
Build -

Last updated: Fri, 10 Jul 2026 17:00:00 GMT

Signed-off-by: Divyanshi Pathak <divyanshipathakqc@mpgi.edu.in>
@traitor09

Copy link
Copy Markdown
Contributor Author

I noticed the backend typecheck was failing due to an unrelated issue in apps/backend/src/routes/event.ts

The EventDetails type requires an organizerId field, but the route wasn't selecting the organizer's id from Prisma or including it in the response. I've included a small fix alongside this PR by:

  • adding id: true to the organizer selection in the Prisma query
  • returning organizerId: details.organizer.id in the response

This doesn't change the migration behavior
it resolves the existing typecheck failure

The tests are currently failing because they still reference the old migration path.

Please review.

@ShantKhatri

Copy link
Copy Markdown
Collaborator
image Linting check fails here. @traitor09

@traitor09

traitor09 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @ShantKhatri That's what I was referring to when I mentioned that the old migration path was still being referenced.

I agree that the first failure is in the lint step which references:

prisma/migrations/20260617074743_refresh_token_cleanup_indexes/migration.sql

which is the migration removed by this PR. The backend test step also references the same deleted migration path.

The CI change-detection script .github/scripts/ciScript.js also processes files that have been deleted in the PR.

Since updating that script would be a CI change outside the original migration task, I didn't want to expand the scope of this PR without checking first.

Would you prefer that I include that CI fix in this PR as well?

Comment thread apps/backend/src/routes/event.ts Outdated
@Harxhit
Harxhit dismissed ShantKhatri’s stale review July 10, 2026 16:45

It is fixed by me.

@Harxhit

Harxhit commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Proof

2026-07-10_22-24-45

@Harxhit Harxhit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed the merge conflicts. Also added the proof.

@Harxhit
Harxhit merged commit b1bd3c2 into Dev-Card:main Jul 10, 2026
4 of 6 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Congratulations @traitor09 on getting PR #647 merged!

Thank you for your contribution to the project.

To receive the appropriate GSSoC labels and recognition, please mention @Harxhit in the #get-labels channel on our Discord server and share your merged PR link.

ShantKhatri added a commit that referenced this pull request Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend gssoc:approved Required label for every approved PR. Gives the base +50 points and enables contribution tracking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fresh DB setup fails due to incomplete Prisma migration history

4 participants