serial('id').primaryKey() vs primaryKey() in extraConfig?

Are there any implications with marking a column as a primary key through the extraConfig argument as opposed to on the column definition? If I define a column like the following, everything seems to behave fine, but I do see that in the snapshot that drizzle marks the column as primaryKey: false and instead considers this a composite PK
export const my_table = pgTable(
'my_table',
{
id: serial('id').primaryKey(),
},
(table) => ({
pk: primaryKey({ columns: [table.id] }),
})
)
export const my_table = pgTable(
'my_table',
{
id: serial('id').primaryKey(),
},
(table) => ({
pk: primaryKey({ columns: [table.id] }),
})
)
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server