Hi, im trying to generate a cuid in PostgresSql with prisma by default.
This is my schema:
model Room {
id String @id @default(cuid())
}
This is my Code (NextJS server action):
export const createRoom = async () => {
await prisma.room.create({});
};
I get this Error:
Null constraint violation on the fields: (`id`)
at async createRoom
This is the query which is executed
INSERT INTO "public"."Room" DEFAULT VALUES RETURNING "public"."Room"."id"
Do I need to create the cuid myself when i create a room?