drizzle asks for <table> `id` when doing insert
I guess the ID should be autogenerated by the database itself, but not sure why it's asking me to pass it as a value when doing
using mysql, @planetscale/database
my schemas:
4 Replies
You never specify in your schema that the id should be autogenerated - as-is, it’s just a normal string column
isn't it what
.primaryKey()
does?with .primaryKey() you only indicate that this column is the key of the record in the table, you must indicate separately that it is an AUTO_INCREMENT data, or you can use id: uuid('id').defaultRandom().primaryKey().
I get it now, thanks a lot