Commit f8c9594
fix(showcase): stop passing a non-existent org column when seeding the phone demo user (#3408)
The approval demo's `ensurePhoneDemoUser` inserted `sys_user` with an
`organization_id` key. `sys_user` has no such field — not in the object
definition (25 fields, none org/tenant) and not physically (26 columns, no
`organization_id`); org membership lives on `sys_member`. The key is not
dropped on the way down: it reaches SQL as a real column and the insert dies
with `table sys_user has no column named organization_id`.
The insert is wrapped in a best-effort try/catch, so this surfaced only as a
warn line and an ERROR in the boot log — and the demo user was **never**
provisioned on any boot, leaving the phone surfaces (#3358 §6 "Phone sign-in
surfaces": All Users list, record detail) empty with nothing to look at.
Also drop the dead `admin.organization_id` read in `run`: the same missing
field made it permanently `undefined`, so only the `sys_member` fallback ever
ran. Resolve from `sys_member` directly and correct the comment, which claimed
the column existed but was null.
Verified on a wiped dev DB: boot log goes from 1 ERROR to 0, and
`sys_user` now holds `usr_showcase_phone_demo` / `Mei Phone (demo)` /
`+8613800138000`. Approval fixtures unaffected (2 pending requests + 3 admin
positions still stamped with the org). `tsc --noEmit` passes.
Follow-up to #3364; found while collecting evidence for #3358 §1.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent f243727 commit f8c9594
1 file changed
Lines changed: 17 additions & 21 deletions
Lines changed: 17 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
| |||
215 | 213 | | |
216 | 214 | | |
217 | 215 | | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
229 | 225 | | |
230 | 226 | | |
231 | | - | |
| 227 | + | |
232 | 228 | | |
233 | 229 | | |
234 | 230 | | |
| |||
0 commit comments