Prisma migration - #683
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Deploy Preview for carriage-web ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
mjaydenkim
left a comment
There was a problem hiding this comment.
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
| firstName String | ||
| lastName String | ||
| roles AdminRole[] | ||
| isDriver Boolean @default(false) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| id String @id @default(uuid()) | ||
| firstName String | ||
| lastName String | ||
| roles AdminRole[] |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
I like how much a lot of this server-side code is cleaned up -- great work!
There was a problem hiding this comment.
Forgot to mention this earlier -- any specific plans or outlines on how we plan to host our database?
…sting in edit modal
|
[diff-counting] Significant lines: 31215. This diff might be too big! Developer leads are invited to review the code. |
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 generatecan 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
Test Plan
Notes
Breaking Changes