Conversation
|
|
|
Hey there and thank you for opening this pull request! 👋🏼 We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted. Details: |
There was a problem hiding this comment.
1 issue found across 3 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/prisma/schema.prisma">
<violation number="1" location="packages/prisma/schema.prisma:975">
P2: New `Booking.businessId` foreign key is missing an explicit index, risking slower business-based lookups/joins and FK maintenance scans on PostgreSQL.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| report BookingReport? | ||
|
|
||
| //OKBOOMER: business linkage | ||
| businessId Int? |
There was a problem hiding this comment.
P2: New Booking.businessId foreign key is missing an explicit index, risking slower business-based lookups/joins and FK maintenance scans on PostgreSQL.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/prisma/schema.prisma, line 975:
<comment>New `Booking.businessId` foreign key is missing an explicit index, risking slower business-based lookups/joins and FK maintenance scans on PostgreSQL.</comment>
<file context>
@@ -899,6 +971,10 @@ model Booking {
report BookingReport?
+ //OKBOOMER: business linkage
+ businessId Int?
+ business Business? @relation("BusinessBookings", fields: [businessId], references: [id])
+
</file context>
Ryukemeister
left a comment
There was a problem hiding this comment.
hey there, thank you for contribution. can you please link the github issue this fixes. also curious, what exactly is the benefit of this?
Adds Business and Service models to the Prisma schema and links Booking and User to a business to support per-business service menus and notification settings.
Custom database schema
Summary by cubic
Adds
BusinessandServicemodels to the Prisma schema and linksBookingandUserto a business to support per-business service menus and notification settings.New Features
Businessmodel withstatus, contact fields, notification toggles, uniqueslug, timestamps, and index onlineUserId.Servicemodel linked to a business with name/description, price, duration, image,isActive, category; unique per-business name and indexed bybusinessId.Booking.businessIdFK toBusiness(SET NULLon delete).User.primaryBusinessIdFK toBusinesswith a unique constraint.Migration
packages/prisma(e.g.,prisma migrate deploy).Businessrecords, setUser.primaryBusinessIdandBooking.businessIdwhere applicable.Business.slug;Servicename per business; only oneUsercan reference a givenBusinessas primary.Written for commit a7d098f. Summary will update on new commits.