Commit 5c477c1
fix: migrate legacy tables by adding missing scope/timestamp/metadata columns (#326)
Previously doInitialize() only logged a warning when detecting missing columns
but never actually added them, causing stats/list/search/update/delete to fail
with "No field named scope" on databases upgraded from legacy memory-lancedb.
Now uses table.schema() to detect missing columns and table.addColumns() to
add them with sensible defaults (scope='global', timestamp=0.0, metadata='{}').
Handles concurrent initialization race via "already exists" error detection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 699b0f2 commit 5c477c1
1 file changed
+28
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | | - | |
264 | | - | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
265 | 278 | | |
266 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
267 | 284 | | |
268 | 285 | | |
269 | 286 | | |
270 | | - | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
271 | 294 | | |
272 | 295 | | |
273 | 296 | | |
| |||
0 commit comments