Skip to content

Prisma migration - #683

Open
anika-4444 wants to merge 12 commits into
masterfrom
prisma-migration
Open

Prisma migration#683
anika-4444 wants to merge 12 commits into
masterfrom
prisma-migration

Conversation

@anika-4444

Copy link
Copy Markdown
Contributor

Summary

This is the migration from DyanmoDB to PrismaPostgres. Included in this PR is the schema rewrite and routes changed to use Prisma. There is also a lot of files that Prisma auto-generated during the schema creation.

When testing, running npx prisma generate can be helpful to see the database better formatted. You will also have to create a local instance of the db.

Recurring rides still needs to be implemented, but I'll do that in a separate PR.

This pull request is the first step towards implementing prisma re-write

  • implemented schema change
  • changed router files
  • in a separate PR, I'll delete all the dynamo schema leftovers.

Test Plan

Notes

Breaking Changes

@anika-4444
anika-4444 requested a review from a team as a code owner March 23, 2026 03:07
@vercel

vercel Bot commented Mar 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cu-carriage Error Error Apr 22, 2026 11:07pm

@netlify

netlify Bot commented Mar 23, 2026

Copy link
Copy Markdown

Deploy Preview for carriage-web ready!

Name Link
🔨 Latest commit fe6546b
🔍 Latest deploy log https://app.netlify.com/projects/carriage-web/deploys/69e954b85120980008c4efc7
😎 Deploy Preview https://deploy-preview-683--carriage-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@mjaydenkim mjaydenkim 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.

Hey -- great work overall! I made a few commits with small changes, this looks great overall though, I did a basic run-through of most app flows and they worked well! Just one major change I'm suggesting (merging the admin/driver tables); other than that I don't see any problems! Good stuff <33

Comment thread server/prisma/schema.prisma Outdated
firstName String
lastName String
roles AdminRole[]
isDriver Boolean @default(false)

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.

From the admin side, if you have an admin and you check the box to say they're also a driver it returns an error if they're not already a driver. Might be a bit more work but can we merge the employee models (e.g. Admin and Driver)? It would make it a lot easier to handle people who are both; this was a problem in the original schema design, where deleting an employee would delete them from one of the tables at random but not really both.

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.

If I add an employee with my exact details and check the "driver" box it merges the two entries. I think this should be one table.

Comment thread server/prisma/schema.prisma Outdated
id String @id @default(uuid())
firstName String
lastName String
roles AdminRole[]

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.

When I try to set employee roles using the dialog it sets and then resets automatically on the UI. Don't know why that is, the request posts correctly, but it's very suspicious.


/// A rider who requests and takes rides
model Rider {
id String @id @default(uuid())

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.

Good work with these models, they make good sense to me and integrate well with the current app!

return null; // User not found in Riders table
}
if (requestedUserType === 'Rider') {
const rider = await prisma.rider.findUnique({

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.

I like how much a lot of this server-side code is cleaned up -- great work!

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.

Forgot to mention this earlier -- any specific plans or outlines on how we plan to host our database?

@dti-github-bot

dti-github-bot commented Apr 22, 2026

Copy link
Copy Markdown
Member

[diff-counting] Significant lines: 31215. This diff might be too big! Developer leads are invited to review the code.

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