-
Notifications
You must be signed in to change notification settings - Fork 3
ドメインモデル精査 #174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ドメインモデル精査 #174
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refines the domain model by migrating primary keys to UUIDs and restructuring the topping customization relations.
- Switched
orders
anddons
models to use UUID string IDs and renamed timestamp fields. - Introduced
customizes
andcustomize_prices
models to replace the old toppings schema. - Added
don_customizes
join model but missing composite key and has a naming mismatch.
Comments suppressed due to low confidence (2)
packages/backend/prisma/schema.prisma:35
- [nitpick] The field
topping_id
refers to thecustomizes
model. Renaming it tocustomize_id
would align the name with the related model and improve clarity.
topping_id String @db.Uuid
packages/backend/prisma/schema.prisma:44
- The
@db.VarChar()
attribute requires a length parameter (e.g.,@db.VarChar(255)
). Please specify the maximum length for this column to avoid schema generation errors.
label String @db.VarChar()
don_id String @id @db.Uuid | ||
topping_id String @db.Uuid | ||
amount Int // 負も取りうる (0がデフォルト量) | ||
|
||
model options { | ||
id Int @id @default(autoincrement()) | ||
label String @db.VarChar(255) | ||
customize customizes @relation(fields: [topping_id], references: [id]) | ||
don dons @relation(fields: [don_id], references: [id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The don_customizes model defines don_id as the sole primary key, which prevents associating multiple customizations with the same don. Consider removing @id
from don_id
and adding a composite primary key: @@id([don_id, topping_id])
.
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメントしたところ以外は良さそうです!
create_datetime DateTime @default(now()) | ||
update_datetime DateTime @updatedAt | ||
order orders @relation(fields: [order_id], references: [id]) | ||
don_customizes don_customizes[] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stateを生やす
インデックス貼りたいですが、prisma schemaってindexも記載できるのでしたっけ?
} | ||
model don_customizes { | ||
don_id String @id @db.Uuid | ||
topping_id String @db.Uuid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
customize_idですかね?
seed作り直したいですね。 |
作りました #176 |
…and order management
…nt-under-.api-from-prisma.schema Add OpenAPI components reflecting Prisma models
Fixes #112