4 Replies
You defined the id as notNull but didn't define a default value
Drizzle is asking you to provide it
@Russell what is your updated/fixed code?
@Angelelz I don't understand why
userId: "d",
line in planData
solves the issue because OP is passing a value to userId
column. Could you elaborate please?Although the error is talking about userId, the problem is actually the id.
In the table definition, id is not null but it doesn't have a default value, nor it autogenerates, hence a type error when you don't provide it in the insert
Actually, rating is also required
@Angelelz i posted a simplified version of this problem here (and default value is included), could we continue the discussion there please?
https://discord.com/channels/1043890932593987624/1247493906627559495