Bind booleans as bool for the postgres dialect in auth and conversations #64

Merged
weichen merged 1 commits from feature/store-pg-bool-dialect into main 2026-10-05 02:53:24 +00:00
Owner

Why

PG 档下布尔列被写成 1/0 字面量与 boolInt 整数参数(SQLite 容忍、PG 报 42804):10-04 的 user create 在 pg1 半失败(空 password_hash、is_admin=f),password reset / user list(bool 扫进 int)/ 登录(GetUserAuthState 扫描)在 PG 档全部不可用。

What

  • 写:CreateAccount / SetUserPassword / ClearMustChangePassword 的字面量改绑 Go bool;SetConversationFlags 四个标记参数去 boolInt。
  • 读:GetUserAuthState / ListUsersAdmin / scanConversation / GetConversation 直接扫进 bool(SQLite 0/1 经 driver.Bool 转换,两方言通用)。

Evidence

  • store 测试绿;对活体 pg1 用修复后 CLI 完成 user reset-password 与 user list(isAdmin=true, mustChangePassword=true, hasPassword=true)。

Impact

PG 档的账号管理与会话标记/列表路径恢复可用;SQLite 行为不变;无 schema 变更。

Refs

Dev 仓 gitlink bump PR(同名分支)

## Why PG 档下布尔列被写成 1/0 字面量与 boolInt 整数参数(SQLite 容忍、PG 报 42804):10-04 的 user create 在 pg1 半失败(空 password_hash、is_admin=f),password reset / user list(bool 扫进 int)/ 登录(GetUserAuthState 扫描)在 PG 档全部不可用。 ## What - 写:CreateAccount / SetUserPassword / ClearMustChangePassword 的字面量改绑 Go bool;SetConversationFlags 四个标记参数去 boolInt。 - 读:GetUserAuthState / ListUsersAdmin / scanConversation / GetConversation 直接扫进 bool(SQLite 0/1 经 driver.Bool 转换,两方言通用)。 ## Evidence - store 测试绿;对活体 pg1 用修复后 CLI 完成 user reset-password 与 user list(isAdmin=true, mustChangePassword=true, hasPassword=true)。 ## Impact PG 档的账号管理与会话标记/列表路径恢复可用;SQLite 行为不变;无 schema 变更。 ## Refs Dev 仓 gitlink bump PR(同名分支)
weichen added 1 commit 2026-10-05 02:53:17 +00:00
Why: user create/reset-password and conversation flag updates wrote 1/0
literals and boolInt ints into BOOLEAN columns; SQLite tolerates it,
PostgreSQL rejects with 42804. The 10-04 user create on pg1 failed midway
(empty password_hash, is_admin=f), and password reset, user list (bool
scanned into int) and login (GetUserAuthState scan) were all broken on
the postgres tier.

Evidence: store tests green; against the live pg1 the fixed CLI completes
user reset-password and user list (isAdmin=true, mustChangePassword=true,
hasPassword=true).

Impact: auth/account management and conversation list/flag paths work on
postgres; SQLite unchanged (0/1 converts via driver.Bool). No schema
changes.

Refs: dev-repo PR for gitlink bump (feature/store-pg-bool-dialect)
weichen force-pushed feature/store-pg-bool-dialect from 0cb7e97a20 to 14aa60b698 2026-10-05 02:53:17 +00:00 Compare
weichen merged commit dc3462b62b into main 2026-10-05 02:53:24 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Backend#64