Drizzle-adapter ignores additional fields when updating entity

Hi - i am using the drizzle-adapter and added an additional field (clubId) to my user-table. But, when i try to update my user (set the clubId) the database-field never gets updated. From what i see in the debug-logs, better-auth recognizes the field but the created sql query just does not include the additional field.
2025-07-09T09:22:06.576Z INFO [Better Auth]: [Drizzle Adapter] #2 [1/4] update (Unsafe Input): {
model: "user",
data: {
name: undefined,
image: undefined,
clubId: "db8d18c7-cab4-4a65-a601-02d31d63cfea",
},
}
2025-07-09T09:22:06.576Z INFO [Better Auth]: [Drizzle Adapter] #2 [2/4] update (Parsed Input): {
model: "user",
data: {
club_id: "db8d18c7-cab4-4a65-a601-02d31d63cfea",
},
}
2025-07-09T09:22:06.576Z INFO [Better Auth]: [Drizzle Adapter] #2 [1/4] update (Unsafe Input): {
model: "user",
data: {
name: undefined,
image: undefined,
clubId: "db8d18c7-cab4-4a65-a601-02d31d63cfea",
},
}
2025-07-09T09:22:06.576Z INFO [Better Auth]: [Drizzle Adapter] #2 [2/4] update (Parsed Input): {
model: "user",
data: {
club_id: "db8d18c7-cab4-4a65-a601-02d31d63cfea",
},
}
From these logs i assume that better-auth and drizzle know about the additional field. The created query though just does not include the club_id field Query: update "user" set "updated_at" = $1 where "user"."id" = $2 returning "id", "name", "email", "email_verified", "image", "club_id", "created_at", "updated_at" -- params: ["2025-07-09T09:22:06.577Z", "3xhX1mXNO2PImu6fR7GbeCfUd454dDDY"] Drizzle as well as better-auth also query the clubId from the database and return it:
2025-07-09T09:22:06.580Z INFO [Better Auth]: [Drizzle Adapter] #2 [3/4] update (DB Result): {
model: "user",
data: {
id: "3xhX1mXNO2PImu6fR7GbeCfUd454dDDY",
name: "test name",
email: "test@email.com",
emailVerified: false,
image: null,
clubId: null,
createdAt: 2025-07-09T07:51:38.757Z,
updatedAt: 2025-07-09T09:22:06.577Z,
},
}
2025-07-09T09:22:06.580Z INFO [Better Auth]: [Drizzle Adapter] #2 [4/4] update (Parsed Result): {
model: "user",
data: {
name: "test name",
email: "test@email.com",
emailVerified: false,
image: null,
createdAt: 2025-07-09T07:51:38.757Z,
updatedAt: 2025-07-09T09:22:06.577Z,
clubId: undefined,
id: "3xhX1mXNO2PImu6fR7GbeCfUd454dDDY",
},
}
2025-07-09T09:22:06.580Z INFO [Better Auth]: [Drizzle Adapter] #2 [3/4] update (DB Result): {
model: "user",
data: {
id: "3xhX1mXNO2PImu6fR7GbeCfUd454dDDY",
name: "test name",
email: "test@email.com",
emailVerified: false,
image: null,
clubId: null,
createdAt: 2025-07-09T07:51:38.757Z,
updatedAt: 2025-07-09T09:22:06.577Z,
},
}
2025-07-09T09:22:06.580Z INFO [Better Auth]: [Drizzle Adapter] #2 [4/4] update (Parsed Result): {
model: "user",
data: {
name: "test name",
email: "test@email.com",
emailVerified: false,
image: null,
createdAt: 2025-07-09T07:51:38.757Z,
updatedAt: 2025-07-09T09:22:06.577Z,
clubId: undefined,
id: "3xhX1mXNO2PImu6fR7GbeCfUd454dDDY",
},
}
No description
No description
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?