Redwood requires each model to have a single field annotated with @id in your prisma schema. Without a single @id field, redwood cannot scaffold, generate sdl or services, and cells produce corrupt queries
This is caused by the redwood CLI looking for the model, and then once it finds the model, looking for a single field marked with @id, and that result being null if it does not exist.
How do we reproduce the bug?
// schema.prisma
model Order {
tenantId String
id String @unique @default(uuid())
@@id([tenantId, id])
}
cli:
yarn rw g sdl order
Results in error:
│ WARNING: Cannot generate CRUD SDL without an @id database column. │
What's not working?
Redwood requires each model to have a single field annotated with
@id
in your prisma schema. Without a single@id
field, redwood cannot scaffold, generate sdl or services, and cells produce corrupt queriesThis is caused by the redwood CLI looking for the model, and then once it finds the model, looking for a single field marked with
@id
, and that result being null if it does not exist.How do we reproduce the bug?
cli: yarn rw g sdl order
Results in error: │ WARNING: Cannot generate CRUD SDL without an
@id
database column. │cli: yarn rw g cell order
results in the following cell query:
(see the type of $id)
What's your environment? (If it applies)
No response
Are you interested in working on this?